summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-10-28 10:17:31 -0700
committerJunio C Hamano <gitster@pobox.com>2013-10-28 10:17:31 -0700
commit77bc4302dc93ac33891c72df59d9426eb6d06d0b (patch)
tree84362fb631bfb7c4e1b93d8bd0a26d7319827c8d /t
parentb28325d3ab0172063d1fbe0e735d899ae43c6fee (diff)
parentcd4f09e38341bdd17cf008ea57863e4b10ac176b (diff)
downloadgit-77bc4302dc93ac33891c72df59d9426eb6d06d0b.tar.gz
Merge branch 'jk/shortlog-tolerate-broken-commit' into maint
"git shortlog" used to choke and die when there is a malformed commit (e.g. missing authors); it now simply ignore such a commit and keeps going. * jk/shortlog-tolerate-broken-commit: shortlog: ignore commits with missing authors
Diffstat (limited to 't')
-rwxr-xr-xt/t4201-shortlog.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t4201-shortlog.sh b/t/t4201-shortlog.sh
index 5493500ef1..42866992cf 100755
--- a/t/t4201-shortlog.sh
+++ b/t/t4201-shortlog.sh
@@ -172,4 +172,20 @@ test_expect_success 'shortlog encoding' '
git shortlog HEAD~2.. > out &&
test_cmp expect out'
+test_expect_success 'shortlog ignores commits with missing authors' '
+ git commit --allow-empty -m normal &&
+ git commit --allow-empty -m soon-to-be-broken &&
+ git cat-file commit HEAD >commit.tmp &&
+ sed "/^author/d" commit.tmp >broken.tmp &&
+ commit=$(git hash-object -w -t commit --stdin <broken.tmp) &&
+ git update-ref HEAD $commit &&
+ cat >expect <<-\EOF &&
+ A U Thor (1):
+ normal
+
+ EOF
+ git shortlog HEAD~2.. >actual &&
+ test_cmp expect actual
+'
+
test_done