summaryrefslogtreecommitdiff
path: root/builtin/branch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-03-05 06:17:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-03-05 06:17:52 (GMT)
commit57f75f31311d380a3ccfbfe7f483253591cf0c87 (patch)
tree888f2fde04c7d9b3ed4af4cff48f190d26f9a9fb /builtin/branch.c
parent3ecd0c8b4d9e245e255aa4c061d6a474eb571298 (diff)
parent6c41e97557d94df7085e3c0cff247305c9401968 (diff)
downloadgit-57f75f31311d380a3ccfbfe7f483253591cf0c87.zip
git-57f75f31311d380a3ccfbfe7f483253591cf0c87.tar.gz
git-57f75f31311d380a3ccfbfe7f483253591cf0c87.tar.bz2
Merge branch 'cn/maint-branch-with-bad' into maint
* cn/maint-branch-with-bad: branch: don't assume the merge filter ref exists Conflicts: t/t3200-branch.sh
Diffstat (limited to 'builtin/branch.c')
-rw-r--r--builtin/branch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/branch.c b/builtin/branch.c
index cb17bc3..d8cccf7 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -530,6 +530,10 @@ static int print_ref_list(int kinds, int detached, int verbose, int abbrev, stru
if (merge_filter != NO_FILTER) {
struct commit *filter;
filter = lookup_commit_reference_gently(merge_filter_ref, 0);
+ if (!filter)
+ die("object '%s' does not point to a commit",
+ sha1_to_hex(merge_filter_ref));
+
filter->object.flags |= UNINTERESTING;
add_pending_object(&ref_list.revs,
(struct object *) filter, "");