summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-03 08:43:03 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-03 08:43:03 -0700
commitf1ad05f3a524a8750533d8263ceb584a9e7ec573 (patch)
tree9a7c452694f2718b34ddebf32aacf5a373203d5c /builtin
parent8f780ca9be58d748c79e11b8dccad9474f4d1a19 (diff)
parentc29c46fa2e21e608ce2e603649af5bf38e7969c2 (diff)
downloadgit-f1ad05f3a524a8750533d8263ceb584a9e7ec573.tar.gz
Merge branch 'jk/fully-peeled-packed-ref' into maint-1.8.1
* jk/fully-peeled-packed-ref: pack-refs: add fully-peeled trait pack-refs: write peeled entry for non-tags use parse_object_or_die instead of die("bad object") avoid segfaults on parse_object failure
Diffstat (limited to 'builtin')
-rw-r--r--builtin/grep.c4
-rw-r--r--builtin/prune.c4
2 files changed, 2 insertions, 6 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 0e1b6c860e..e8f0f92cf7 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -820,9 +820,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
unsigned char sha1[20];
/* Is it a rev? */
if (!get_sha1(arg, sha1)) {
- struct object *object = parse_object(sha1);
- if (!object)
- die(_("bad object %s"), arg);
+ struct object *object = parse_object_or_die(sha1, arg);
add_object_array(object, arg, &list);
continue;
}
diff --git a/builtin/prune.c b/builtin/prune.c
index 8cb8b9186a..85843d4f17 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -149,9 +149,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
const char *name = *argv++;
if (!get_sha1(name, sha1)) {
- struct object *object = parse_object(sha1);
- if (!object)
- die("bad object: %s", name);
+ struct object *object = parse_object_or_die(sha1, name);
add_pending_object(&revs, object, "");
}
else