aboutsummaryrefslogtreecommitdiffstats
path: root/tree-walk.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-11-18 16:16:37 -0800
committerJunio C Hamano <gitster@pobox.com>2007-11-18 16:16:37 -0800
commit5d3d1cacc139194672a6a184509bb620a19b2497 (patch)
tree872d798fe9d07c32ff768ca83a5df1450f09a212 /tree-walk.h
parentd577bc58a3424f4d0d7f7c8094753b92cb7cb823 (diff)
parent4d1012c3709e356107d0fb0e3bf5a39e0d5c209d (diff)
downloadgit-5d3d1cacc139194672a6a184509bb620a19b2497.tar.gz
Merge branch 'lt/rev-list-gitlink'
* lt/rev-list-gitlink: Fix rev-list when showing objects involving submodules
Diffstat (limited to 'tree-walk.h')
-rw-r--r--tree-walk.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tree-walk.h b/tree-walk.h
index db0fbdc701..903a7b0f48 100644
--- a/tree-walk.h
+++ b/tree-walk.h
@@ -7,6 +7,13 @@ struct name_entry {
unsigned int mode;
};
+static inline enum object_type object_type(unsigned int mode)
+{
+ return S_ISDIR(mode) ? OBJ_TREE :
+ S_ISGITLINK(mode) ? OBJ_COMMIT :
+ OBJ_BLOB;
+}
+
struct tree_desc {
const void *buffer;
struct name_entry entry;