Merge branch 'rt/commentchar-fmt-merge-msg'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Apr 2013 20:45:01 +0000 (13:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Apr 2013 20:45:01 +0000 (13:45 -0700)
A test fix for recent update.

* rt/commentchar-fmt-merge-msg:
t6200: avoid path mangling issue on Windows

1  2 
t/t6200-fmt-merge-msg.sh
diff --combined t/t6200-fmt-merge-msg.sh
index e7e945db098de4ca491bea5dac36df34bcb13ebd,ff82640aeeda3bfd0a26369427e68119b4cbf9fd..54b5744cc526e172acb79bb204af1800fdceb315
@@@ -112,8 -112,8 +112,8 @@@ test_expect_success '[merge] summary/lo
          Common #1
        EOF
  
 -      git config merge.log true &&
 -      test_might_fail git config --unset-all merge.summary &&
 +      test_config merge.log true &&
 +      test_unconfig merge.summary &&
  
        git checkout master &&
        test_tick &&
  
        git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
  
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary true &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary true &&
  
        git checkout master &&
        test_tick &&
        test_cmp expected actual2
  '
  
 -test_expect_success 'setup: clear [merge] configuration' '
 -      test_might_fail git config --unset-all merge.log &&
 -      test_might_fail git config --unset-all merge.summary
 -'
 -
  test_expect_success 'setup FETCH_HEAD' '
        git checkout master &&
        test_tick &&
@@@ -179,8 -184,8 +179,8 @@@ test_expect_success '--log=5 with custo
        cat >expected <<-EOF &&
        Merge branch ${apos}left${apos}
  
-       / By Another Author (3) and A U Thor (2)
-       / Via Another Committer
+       x By Another Author (3) and A U Thor (2)
+       x Via Another Committer
        * left:
          Left #5
          Left #4
          Common #1
        EOF
  
-       git -c core.commentchar="/" fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual &&
+       git -c core.commentchar="x" fmt-merge-msg --log=5 <.git/FETCH_HEAD >actual &&
        test_cmp expected actual
  '
  
@@@ -261,14 -266,14 +261,14 @@@ test_expect_success 'fmt-merge-msg -m' 
          Common #1
        EOF
  
 -      test_might_fail git config --unset merge.log &&
 -      test_might_fail git config --unset merge.summary &&
 +      test_unconfig merge.log &&
 +      test_unconfig merge.summary &&
        git checkout master &&
        git fetch "$(pwd)" left &&
        git fmt-merge-msg -m "Sync with left" <.git/FETCH_HEAD >actual &&
        git fmt-merge-msg --log -m "Sync with left" \
                                        <.git/FETCH_HEAD >actual.log &&
 -      git config merge.log true &&
 +      test_config merge.log true &&
        git fmt-merge-msg -m "Sync with left" \
                                        <.git/FETCH_HEAD >actual.log-config &&
        git fmt-merge-msg --no-log -m "Sync with left" \
@@@ -303,29 -308,29 +303,29 @@@ test_expect_success 'setup: expected sh
  '
  
  test_expect_success 'shortlog for two branches' '
 -      git config merge.log true &&
 -      test_might_fail git config --unset-all merge.summary &&
 +      test_config merge.log true &&
 +      test_unconfig merge.summary &&
        git checkout master &&
        test_tick &&
        git fetch . left right &&
        git fmt-merge-msg <.git/FETCH_HEAD >actual1 &&
  
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary true &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary true &&
        git checkout master &&
        test_tick &&
        git fetch . left right &&
        git fmt-merge-msg <.git/FETCH_HEAD >actual2 &&
  
 -      git config merge.log yes &&
 -      test_might_fail git config --unset-all merge.summary &&
 +      test_config merge.log yes &&
 +      test_unconfig merge.summary &&
        git checkout master &&
        test_tick &&
        git fetch . left right &&
        git fmt-merge-msg <.git/FETCH_HEAD >actual3 &&
  
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
        git checkout master &&
        test_tick &&
        git fetch . left right &&
  '
  
  test_expect_success 'merge-msg -F' '
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
        git checkout master &&
        test_tick &&
        git fetch . left right &&
  '
  
  test_expect_success 'merge-msg -F in subdirectory' '
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
        git checkout master &&
        test_tick &&
        git fetch . left right &&
  '
  
  test_expect_success 'merge-msg with nothing to merge' '
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
  
        >empty &&
  
@@@ -389,8 -394,8 +389,8 @@@ test_expect_success 'merge-msg tag' 
          Common #1
        EOF
  
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
  
        git checkout master &&
        test_tick &&
@@@ -419,8 -424,8 +419,8 @@@ test_expect_success 'merge-msg two tags
          Common #1
        EOF
  
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
  
        git checkout master &&
        test_tick &&
@@@ -449,8 -454,8 +449,8 @@@ test_expect_success 'merge-msg tag and 
          Common #1
        EOF
  
 -      test_might_fail git config --unset-all merge.log &&
 -      git config merge.summary yes &&
 +      test_unconfig merge.log &&
 +      test_config merge.summary yes &&
  
        git checkout master &&
        test_tick &&
@@@ -477,8 -482,6 +477,8 @@@ test_expect_success 'merge-msg lots of 
                echo "  ..."
        } >expected &&
  
 +      test_config merge.summary yes &&
 +
        git checkout master &&
        test_tick &&
        git fetch . long &&
        test_cmp expected actual
  '
  
 +test_expect_success 'merge-msg with "merging" an annotated tag' '
 +      test_config merge.log true &&
 +
 +      git checkout master^0 &&
 +      git commit --allow-empty -m "One step ahead" &&
 +      git tag -a -m "An annotated one" annote HEAD &&
 +
 +      git checkout master &&
 +      git fetch . annote &&
 +
 +      git fmt-merge-msg <.git/FETCH_HEAD >actual &&
 +      {
 +              cat <<-\EOF
 +              Merge tag '\''annote'\''
 +
 +              An annotated one
 +
 +              * tag '\''annote'\'':
 +                One step ahead
 +              EOF
 +      } >expected &&
 +      test_cmp expected actual &&
 +
 +      test_when_finished "git reset --hard" &&
 +      annote=$(git rev-parse annote) &&
 +      git merge --no-commit $annote &&
 +      {
 +              cat <<-EOF
 +              Merge tag '\''$annote'\''
 +
 +              An annotated one
 +
 +              * tag '\''$annote'\'':
 +                One step ahead
 +              EOF
 +      } >expected &&
 +      test_cmp expected .git/MERGE_MSG
 +'
 +
  test_done