summaryrefslogtreecommitdiff
path: root/src/tree.c
diff options
context:
space:
mode:
authorClemens Buchacher <drizzd@aon.at>2011-12-30 19:03:55 +0100
committerClemens Buchacher <drizzd@aon.at>2011-12-30 20:14:01 +0100
commita26a156349c6d59a80825b9c3f4c9c423fed5d3a (patch)
tree722d3f9cd0a1eae205070041e7af891ca0632c59 /src/tree.c
parente632f68789cc5b69b84b6344402d6b6f1bf6abb2 (diff)
downloadlibgit2-a26a156349c6d59a80825b9c3f4c9c423fed5d3a.tar.gz
move entry_is_tree to tree.h
Diffstat (limited to 'src/tree.c')
-rw-r--r--src/tree.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tree.c b/src/tree.c
index b698a8a24..50a9afae0 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -15,8 +15,6 @@
#define MAX_FILEMODE 0777777
#define MAX_FILEMODE_BYTES 6
-#define ENTRY_IS_TREE(e) ((e)->attr & 040000)
-
static int valid_attributes(const int attributes)
{
return attributes >= 0 && attributes <= MAX_FILEMODE;
@@ -33,8 +31,8 @@ static int entry_sort_cmp(const void *a, const void *b)
const git_tree_entry *entry_b = (const git_tree_entry *)(b);
return git_futils_cmp_path(
- entry_a->filename, entry_a->filename_len, ENTRY_IS_TREE(entry_a),
- entry_b->filename, entry_b->filename_len, ENTRY_IS_TREE(entry_b));
+ entry_a->filename, entry_a->filename_len, entry_is_tree(entry_a),
+ entry_b->filename, entry_b->filename_len, entry_is_tree(entry_b));
}
@@ -717,7 +715,7 @@ static int tree_walk_post(
if (callback(path->ptr, entry, payload) < 0)
continue;
- if (ENTRY_IS_TREE(entry)) {
+ if (entry_is_tree(entry)) {
git_tree *subtree;
size_t path_len = path->size;
@@ -980,7 +978,7 @@ static int diff_index_cb(const char *root, git_tree_entry *tentry, void *data)
git_buf fn_buf = GIT_BUF_INIT;
int cmp, error = GIT_SUCCESS;
- if (ENTRY_IS_TREE(tentry))
+ if (entry_is_tree(tentry))
return GIT_SUCCESS;
git_buf_puts(&fn_buf, root);