]> asedeno.scripts.mit.edu Git - git.git/blobdiff - cache.h
Do not rely on the exit status of "unset" for unset variables
[git.git] / cache.h
diff --git a/cache.h b/cache.h
index aaa135bfde23cd2529e3707e4499be7f75917336..ed8be062990410875b6a1a4cf8663bd5b8a69879 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -192,6 +192,13 @@ enum object_type {
        OBJ_MAX,
 };
 
+static inline enum object_type object_type(unsigned int mode)
+{
+       return S_ISDIR(mode) ? OBJ_TREE :
+               S_ISGITLINK(mode) ? OBJ_COMMIT :
+               OBJ_BLOB;
+}
+
 #define GIT_DIR_ENVIRONMENT "GIT_DIR"
 #define GIT_WORK_TREE_ENVIRONMENT "GIT_WORK_TREE"
 #define DEFAULT_GIT_DIR_ENVIRONMENT ".git"
@@ -613,7 +620,7 @@ extern void alloc_report(void);
 
 /* trace.c */
 extern void trace_printf(const char *format, ...);
-extern void trace_argv_printf(const char **argv, int count, const char *format, ...);
+extern void trace_argv_printf(const char **argv, const char *format, ...);
 
 /* convert.c */
 /* returns 1 if *dst was used */