diff options
author | Junio C Hamano <junkio@cox.net> | 2006-04-26 17:08:00 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-04-26 17:08:00 -0700 |
commit | 69bcc43eca0f251617e3b5db5df632b24db94e92 (patch) | |
tree | d816d41d36c73f3e665e4a2967a59abef4ce12d3 /commit-tree.c | |
parent | 3496277a561307c3d31d2085347af8eb4c667c36 (diff) | |
parent | 5981e09999e90b389a02843671529a0faaf72143 (diff) | |
download | git-69bcc43eca0f251617e3b5db5df632b24db94e92.tar.gz |
Merge branch 'fix'
* fix:
commit-tree.c: check_valid() microoptimization.
Fix filename verification when in a subdirectory
rebase: typofix.
socksetup: don't return on set_reuse_addr() error
Diffstat (limited to 'commit-tree.c')
-rw-r--r-- | commit-tree.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/commit-tree.c b/commit-tree.c index e91af4bd36..bad72e89e8 100644 --- a/commit-tree.c +++ b/commit-tree.c @@ -45,14 +45,13 @@ static void add_buffer(char **bufp, unsigned int *sizep, const char *fmt, ...) static void check_valid(unsigned char *sha1, const char *expect) { - void *buf; char type[20]; - unsigned long size; - buf = read_sha1_file(sha1, type, &size); - if (!buf || strcmp(type, expect)) - die("%s is not a valid '%s' object", sha1_to_hex(sha1), expect); - free(buf); + if (sha1_object_info(sha1, type, NULL)) + die("%s is not a valid object", sha1_to_hex(sha1)); + if (expect && strcmp(type, expect)) + die("%s is not a valid '%s' object", sha1_to_hex(sha1), + expect); } /* |