@@ -33,7 +33,8 @@ class tree : public libgit2_api {
33
33
class entry : public libgit2_api {
34
34
public:
35
35
// Default construction
36
- entry () : c_ptr_(nullptr ), owner_(ownership::libgit2) {}
36
+ entry () : c_ptr_(nullptr ), owner_(ownership::libgit2) {
37
+ }
37
38
38
39
// copy constructor
39
40
entry (const entry &e)
@@ -49,11 +50,13 @@ class tree : public libgit2_api {
49
50
// Construct from libgit2 C ptr
50
51
// If owned by user, will be free'd in destructor
51
52
entry (git_tree_entry *c_ptr, ownership owner = ownership::libgit2)
52
- : c_ptr_(c_ptr), owner_(owner) {}
53
+ : c_ptr_(c_ptr), owner_(owner) {
54
+ }
53
55
54
56
entry (const git_tree_entry *c_ptr)
55
57
: c_ptr_(const_cast <git_tree_entry *>(c_ptr)),
56
- owner_ (ownership::libgit2) {}
58
+ owner_ (ownership::libgit2) {
59
+ }
57
60
58
61
// Clean up tree entry
59
62
~entry () {
@@ -134,7 +137,7 @@ class tree : public libgit2_api {
134
137
entry lookup_entry_by_index (size_t index) const ;
135
138
136
139
// Lookup tree entry by its filename
137
- // Returned entry is owned by the tree
140
+ // Returned entry is owned by the tree
138
141
entry lookup_entry_by_name (const std::string &filename) const ;
139
142
140
143
// Lookup tree entry given its relative path
@@ -143,11 +146,11 @@ class tree : public libgit2_api {
143
146
144
147
// Number of entries in tree
145
148
size_t size () const ;
146
-
149
+
147
150
// get a vector of all tree entries
148
151
std::vector<entry> entries () {
149
152
auto size_= size ();
150
- auto result = std::vector<entry>(size_ );
153
+ auto result = std::vector<entry>();
151
154
for (size_t i=0 ; i < size_ ; i++) {
152
155
result.push_back (lookup_entry_by_index (i));
153
156
}
0 commit comments