Merge branch 'jk/pending-keep-tag-name' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 4 Jan 2016 22:03:07 +0000 (14:03 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 4 Jan 2016 22:03:08 +0000 (14:03 -0800)
History traversal with "git log --source" that starts with an
annotated tag failed to report the tag as "source", due to an
old regression in the command line parser back in v2.2 days.

* jk/pending-keep-tag-name:
revision.c: propagate tag names from pending array

1  2 
revision.c
t/t4202-log.sh
diff --cc revision.c
Simple merge
diff --cc t/t4202-log.sh
index 6ede0692f6de9f2da011dd8b7361bfc53aba7253,043c48e2992ab8ad3f4fc6c58961b078b307f53a..cb82eb7e66b4feb24086407019a812f46b715a34
@@@ -890,22 -872,33 +890,51 @@@ test_expect_success GPG 'log --graph --
        grep "^| | gpg: Good signature" actual
  '
  
 +test_expect_success 'log --graph --no-walk is forbidden' '
 +      test_must_fail git log --graph --no-walk
 +'
 +
 +test_expect_success 'log diagnoses bogus HEAD' '
 +      git init empty &&
 +      test_must_fail git -C empty log 2>stderr &&
 +      test_i18ngrep does.not.have.any.commits stderr &&
 +      echo 1234abcd >empty/.git/refs/heads/master &&
 +      test_must_fail git -C empty log 2>stderr &&
 +      test_i18ngrep broken stderr &&
 +      echo "ref: refs/heads/invalid.lock" >empty/.git/HEAD &&
 +      test_must_fail git -C empty log 2>stderr &&
 +      test_i18ngrep broken stderr &&
 +      test_must_fail git -C empty log --default totally-bogus 2>stderr &&
 +      test_i18ngrep broken stderr
 +'
 +
+ test_expect_success 'set up --source tests' '
+       git checkout --orphan source-a &&
+       test_commit one &&
+       test_commit two &&
+       git checkout -b source-b HEAD^ &&
+       test_commit three
+ '
+ test_expect_success 'log --source paints branch names' '
+       cat >expect <<-\EOF &&
+       09e12a9 source-b three
+       8e393e1 source-a two
+       1ac6c77 source-b one
+       EOF
+       git log --oneline --source source-a source-b >actual &&
+       test_cmp expect actual
+ '
+ test_expect_success 'log --source paints tag names' '
+       git tag -m tagged source-tag &&
+       cat >expect <<-\EOF &&
+       09e12a9 source-tag three
+       8e393e1 source-a two
+       1ac6c77 source-tag one
+       EOF
+       git log --oneline --source source-tag source-a >actual &&
+       test_cmp expect actual
+ '
  test_done