Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-07-01 04:13:07 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-07-01 09:33:47 +0400
commitc62266f37c677c1de7415ac6cf1e2eb6726590e1 (patch)
tree995538e5c635827aee1075b62d8d5b61899bbdb0 /cat-file.c
parentd0efc8a71da1855c705fd2074b219bcb158b6dbd (diff)
[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>
Diffstat (limited to 'cat-file.c')
-rw-r--r--cat-file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/cat-file.c b/cat-file.c
index 85a5d4caed..fa0bb722a2 100644
--- a/cat-file.c
+++ b/cat-file.c
@@ -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);