Line data Source code
1 : /*! 2 : * \file esys/repo/libgit2/guardassign_libgit2.cpp 3 : * \brief 4 : * 5 : * \cond 6 : * __legal_b__ 7 : * 8 : * Copyright (c) 2021 Michel Gillet 9 : * Distributed under the MIT License. 10 : * (See accompanying file LICENSE.txt or 11 : * copy at https://opensource.org/licenses/MIT) 12 : * 13 : * __legal_e__ 14 : * \endcond 15 : * 16 : */ 17 : 18 : #include "esys/repo/esysrepo_prec.h" 19 : #include "esys/repo/libgit2/guardassign.h" 20 : #include "esys/repo/libgit2/guard.h" 21 : 22 : namespace esys::repo::libgit2 23 : { 24 : 25 : template<> 26 11 : ESYSREPO_API int guard_assign<git_commit>(Guard<git_commit> *dest, const Guard<git_commit> &src) 27 : { 28 : // If a previous object is guarded, release it 29 11 : dest->reset(); 30 : 31 11 : return git_commit_dup(dest->get_p(), src.get()); 32 : } 33 : 34 : } // namespace esys::repo::libgit2