aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-06-27 12:07:55 -0700
committerJunio C Hamano <gitster@pobox.com>2010-06-27 12:07:55 -0700
commitcf4403a01070f03e5c5cc65b52c1351d20ff4e91 (patch)
treef96c26b4d03521fbed7774703672ccffc4b4876d /cache.h
parent6aa206413ad7755577cfe29b8ffd16082c211a07 (diff)
parent9f77fe022425360dced8b1f19275852e89d2351c (diff)
downloadgit-cf4403a01070f03e5c5cc65b52c1351d20ff4e91.tar.gz
git-cf4403a01070f03e5c5cc65b52c1351d20ff4e91.tar.xz
Merge branch 'cp/textconv-cat-file'
* cp/textconv-cat-file: git-cat-file.txt: Document --textconv t/t8007: test textconv support for cat-file textconv: support for cat_file sha1_name: add get_sha1_with_context()
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index ff4a7c26d..c9fa3df7f 100644
--- a/cache.h
+++ b/cache.h
@@ -750,12 +750,23 @@ static inline unsigned int hexval(unsigned char c)
#define MINIMUM_ABBREV 4
#define DEFAULT_ABBREV 7
+struct object_context {
+ unsigned char tree[20];
+ char path[PATH_MAX];
+ unsigned mode;
+};
+
extern int get_sha1(const char *str, unsigned char *sha1);
extern int get_sha1_with_mode_1(const char *str, unsigned char *sha1, unsigned *mode, int gently, const char *prefix);
static inline int get_sha1_with_mode(const char *str, unsigned char *sha1, unsigned *mode)
{
return get_sha1_with_mode_1(str, sha1, mode, 1, NULL);
}
+extern int get_sha1_with_context_1(const char *name, unsigned char *sha1, struct object_context *orc, int gently, const char *prefix);
+static inline int get_sha1_with_context(const char *str, unsigned char *sha1, struct object_context *orc)
+{
+ return get_sha1_with_context_1(str, sha1, orc, 1, NULL);
+}
extern int get_sha1_hex(const char *hex, unsigned char *sha1);
extern char *sha1_to_hex(const unsigned char *sha1); /* static buffer result! */
extern int read_ref(const char *filename, unsigned char *sha1);