[PATCH] Makefile: The big git command renaming fallout fix.
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index 4ef80c392adb19df21a779edab366f99b7850e54..aca98f3ec655e0b3530b0f84b5226a51879da95a 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -143,8 +143,25 @@ extern int error(const char *err, ...);
 
 extern int cache_name_compare(const char *name1, int len1, const char *name2, int len2);
 
-extern void *read_tree_with_tree_or_commit_sha1(const unsigned char *sha1,
-                                               unsigned long *size,
-                                               unsigned char *tree_sha1_ret);
+extern void *read_object_with_reference(const unsigned char *sha1,
+                                       const unsigned char *required_type,
+                                       unsigned long *size,
+                                       unsigned char *sha1_ret);
+
+static inline void *xmalloc(int size)
+{
+       void *ret = malloc(size);
+       if (!ret)
+               die("Out of memory, malloc failed");
+       return ret;
+}
+
+static inline void *xrealloc(void *ptr, int size)
+{
+       void *ret = realloc(ptr, size);
+       if (!ret)
+               die("Out of memory, realloc failed");
+       return ret;
+}
 
 #endif /* CACHE_H */