diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-06-27 12:07:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-27 12:07:55 -0700 |
commit | cf4403a01070f03e5c5cc65b52c1351d20ff4e91 (patch) | |
tree | f96c26b4d03521fbed7774703672ccffc4b4876d /cache.h | |
parent | 6aa206413ad7755577cfe29b8ffd16082c211a07 (diff) | |
parent | 9f77fe022425360dced8b1f19275852e89d2351c (diff) | |
download | git-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.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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); |