X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-prune.c;h=8591d28b8e91c94636e9bf8b7e8ff5abcc0705e9;hb=08a19d873c16aa6127bf4c40cf99a9dd19558a0c;hp=286a94c3fc46e2af1f0a31fbaa4aaacf7b876783;hpb=21f88ac84a024fcc73a22547e51509aa1459ab03;p=git.git diff --git a/builtin-prune.c b/builtin-prune.c index 286a94c3f..8591d28b8 100644 --- a/builtin-prune.c +++ b/builtin-prune.c @@ -20,10 +20,11 @@ static int prune_object(char *path, const char *filename, const unsigned char *s const char *type; if (show_only) { - type = buf; - if (sha1_object_info(sha1, type, NULL)) + if (sha1_object_info(sha1, buf, NULL)) type = "unknown"; - printf("%s %s\n", sha1_to_hex(sha1), type ); + else + type = buf; + printf("%s %s\n", sha1_to_hex(sha1), type); return 0; } unlink(mkpath("%s/%s", path, filename));