summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-11-24 10:54:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-11-24 10:54:37 (GMT)
commitac1471b39f1413046d4e338d898a93e403cbd3e5 (patch)
tree3d441acb7efdfcb5e41d2b25a060a7d3098f4057
parent21f88ac84a024fcc73a22547e51509aa1459ab03 (diff)
downloadgit-ac1471b39f1413046d4e338d898a93e403cbd3e5.zip
git-ac1471b39f1413046d4e338d898a93e403cbd3e5.tar.gz
git-ac1471b39f1413046d4e338d898a93e403cbd3e5.tar.bz2
Typefix builtin-prune.c::prune_object()
It passed (const char*) to a function that took a (char *); the buffer itself was of course writable, so pass the buffer itself. Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--builtin-prune.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/builtin-prune.c b/builtin-prune.c
index 286a94c..8591d28 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));