We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f1475c3 commit b924adfCopy full SHA for b924adf
include/cppgit2/tree.hpp
@@ -35,6 +35,17 @@ class tree : public libgit2_api {
35
// Default construction
36
entry() : c_ptr_(nullptr), owner_(ownership::libgit2) {}
37
38
+ // copy constructor
39
+ entry(const entry &e)
40
+ : c_ptr_(e.c_ptr_), owner_(e.owner_) {
41
+
42
+ if (c_ptr_ && owner_ == ownership::user) {
43
+ if (git_tree_entry_dup(&c_ptr_, e.c_ptr_)){
44
+ throw git_exception();
45
+ }
46
47
48
49
// Construct from libgit2 C ptr
50
// If owned by user, will be free'd in destructor
51
entry(git_tree_entry *c_ptr, ownership owner = ownership::libgit2)
0 commit comments