[PATCH] Avoid unnecessarily inflating and interpreting delta
This teaches packed_delta_info() that it only needs to look at the type of the base object to figure out both type and size of a deltified object. This saves quite a many calls to inflate() when dealing with a deep delta chain. Signed-off-by: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
d0efc8a71d
commit
c62266f37c
@ -16,7 +16,8 @@ int main(int argc, char **argv)
|
||||
usage("git-cat-file [-t | -s | tagname] <sha1>");
|
||||
|
||||
if (!strcmp("-t", argv[1]) || !strcmp("-s", argv[1])) {
|
||||
if (!sha1_object_info(sha1, type, &size)) {
|
||||
if (!sha1_object_info(sha1, type,
|
||||
argv[1][1] == 's' ? &size : NULL)) {
|
||||
switch (argv[1][1]) {
|
||||
case 't':
|
||||
printf("%s\n", type);
|
||||
|
Reference in New Issue
Block a user