aboutsummaryrefslogtreecommitdiff
path: root/tree-walk.h
diff options
context:
space:
mode:
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 db0fbdc70..903a7b0f4 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;