mirror of
https://github.com/git/git.git
synced 2026-03-29 19:10:10 +02:00
Merge branch 'cp/textconv-cat-file' (early part) into next
* 'cp/textconv-cat-file' (early part): t/t8007: test textconv support for cat-file textconv: support for cat_file sha1_name: add get_sha1_with_context()
This commit is contained in:
11
cache.h
11
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);
|
||||
|
||||
Reference in New Issue
Block a user