Skip to content

Commit f3307de

Browse files
author
Junio C Hamano
committed
Merge branch 'ap/prune'
* ap/prune: Typefix builtin-prune.c::prune_object() Improve git-prune -n output
2 parents 3fbe2d5 + ac1471b commit f3307de

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

builtin-prune.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,15 @@ static struct rev_info revs;
1616

1717
static int prune_object(char *path, const char *filename, const unsigned char *sha1)
1818
{
19+
char buf[20];
20+
const char *type;
21+
1922
if (show_only) {
20-
printf("would prune %s/%s\n", path, filename);
23+
if (sha1_object_info(sha1, buf, NULL))
24+
type = "unknown";
25+
else
26+
type = buf;
27+
printf("%s %s\n", sha1_to_hex(sha1), type);
2128
return 0;
2229
}
2330
unlink(mkpath("%s/%s", path, filename));

0 commit comments

Comments
 (0)