diff options
author | Vicent Martà <vicent@github.com> | 2012-08-21 14:32:09 -0700 |
---|---|---|
committer | Vicent Martà <vicent@github.com> | 2012-08-21 14:32:09 -0700 |
commit | 697665c0c13e45a5d24af85c133ffaa0a0e0f8cc (patch) | |
tree | 9e32cfadd2e1ffaa05f72dd5871551180ee0afb9 /src/notes.c | |
parent | b2be351aaddc6ba0b3a0f2cf4e09536a3b27e598 (diff) | |
parent | 9d7ac675d06dab2e000ad32f9248631af0191f85 (diff) | |
download | libgit2-697665c0c13e45a5d24af85c133ffaa0a0e0f8cc.tar.gz |
Merge pull request #889 from nulltoken/filemode-enum
Filemode enum
Diffstat (limited to 'src/notes.c')
-rw-r--r-- | src/notes.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/notes.c b/src/notes.c index 6f9e7779d..81e4e5073 100644 --- a/src/notes.c +++ b/src/notes.c @@ -33,7 +33,7 @@ static int find_subtree_in_current_level( if (!git__ishex(git_tree_entry_name(entry))) continue; - if (S_ISDIR(git_tree_entry_attributes(entry)) + if (S_ISDIR(git_tree_entry_filemode(entry)) && strlen(git_tree_entry_name(entry)) == 2 && !strncmp(git_tree_entry_name(entry), annotated_object_sha + fanout, 2)) return git_tree_lookup(out, repo, git_tree_entry_id(entry)); @@ -180,7 +180,7 @@ static int manipulate_note_in_tree_r( subtree_name[2] = '\0'; error = tree_write(out, repo, parent, git_tree_id(new), - subtree_name, 0040000); + subtree_name, GIT_FILEMODE_TREE); cleanup: @@ -252,7 +252,13 @@ static int insert_note_in_tree_enotfound_cb(git_tree **out, GIT_UNUSED(current_error); /* No existing fanout at this level, insert in place */ - return tree_write(out, repo, parent, note_oid, annotated_object_sha + fanout, 0100644); + return tree_write( + out, + repo, + parent, + note_oid, + annotated_object_sha + fanout, + GIT_FILEMODE_BLOB); } static int note_write(git_oid *out, |