Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Tue, 28 Dec 2010 21:50:11 +0000 (13:50 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Dec 2010 21:50:11 +0000 (13:50 -0800)
* maint:
Prepare for 1.7.3.5
Fix false positives in t3404 due to SHELL=/bin/false
close file on error in read_mmfile()

Conflicts:
RelNotes

1  2 
t/t3404-rebase-interactive.sh
index d3a3bd2679e061ce391930d2b59831aa7610926f,9e9474e9447c8835eb4ef30714b577896a06924d..7d8147bb93df482cf7e11338ac96acdf43cf551e
@@@ -7,39 -7,34 +7,39 @@@ test_description='git rebase interactiv
  
  This test runs git rebase "interactively", by faking an edit, and verifies
  that the result still makes sense.
 +
 +Initial setup:
 +
 +     one - two - three - four (conflict-branch)
 +   /
 + A - B - C - D - E            (master)
 + | \
 + |   F - G - H                (branch1)
 + |     \
 + |\      I                    (branch2)
 + | \
 + |   J - K - L - M            (no-conflict-branch)
 +  \
 +    N - O - P                 (no-ff-branch)
 +
 + where A, B, D and G all touch file1, and one, two, three, four all
 + touch file "conflict".
  '
  . ./test-lib.sh
  
  . "$TEST_DIRECTORY"/lib-rebase.sh
  
 +test_cmp_rev () {
 +      git rev-parse --verify "$1" >expect.rev &&
 +      git rev-parse --verify "$2" >actual.rev &&
 +      test_cmp expect.rev actual.rev
 +}
 +
  set_fake_editor
  
 -# Set up the repository like this:
 -#
 -#     one - two - three - four (conflict-branch)
 -#   /
 -# A - B - C - D - E            (master)
 -# | \
 -# |   F - G - H                (branch1)
 -# |     \
 -# |\      I                    (branch2)
 -# | \
 -# |   J - K - L - M            (no-conflict-branch)
 -#  \
 -#    N - O - P                 (no-ff-branch)
 -#
 -# where A, B, D and G all touch file1, and one, two, three, four all
 -# touch file "conflict".
 -#
  # WARNING: Modifications to the initial repository can change the SHA ID used
  # in the expect2 file for the 'stop on conflicting pick' test.
  
 -
  test_expect_success 'setup' '
        test_commit A file1 &&
        test_commit B file1 &&
        test_commit G file1 &&
        test_commit H file5 &&
        git checkout -b branch2 F &&
 -      test_commit I file6
 +      test_commit I file6 &&
        git checkout -b conflict-branch A &&
 -      for n in one two three four
 -      do
 -              test_commit $n conflict
 -      done &&
 +      test_commit one conflict &&
 +      test_commit two conflict &&
 +      test_commit three conflict &&
 +      test_commit four conflict &&
        git checkout -b no-conflict-branch A &&
 -      for n in J K L M
 -      do
 -              test_commit $n file$n
 -      done &&
 +      test_commit J fileJ &&
 +      test_commit K fileK &&
 +      test_commit L fileL &&
 +      test_commit M fileM &&
        git checkout -b no-ff-branch A &&
 -      for n in N O P
 -      do
 -              test_commit $n file$n
 -      done
 +      test_commit N fileN &&
 +      test_commit O fileO &&
 +      test_commit P fileP
  '
  
  # "exec" commands are ran with the user shell by default, but this may
  # be non-POSIX. For example, if SHELL=zsh then ">file" doesn't work
  # to create a file. Unseting SHELL avoids such non-portable behavior
- # in tests.
+ # in tests. It must be exported for it to take effect where needed.
  SHELL=
+ export SHELL
  
  test_expect_success 'rebase -i with the exec command' '
        git checkout master &&
        test_path_is_file touch-one &&
        test_path_is_file touch-two &&
        test_path_is_missing touch-three " (should have stopped before)" &&
 -      test $(git rev-parse C) = $(git rev-parse HEAD) || {
 -              echo "Stopped at wrong revision:"
 -              echo "($(git describe --tags HEAD) instead of C)"
 -              false
 -      } &&
 +      test_cmp_rev C HEAD &&
        git rebase --continue &&
        test_path_is_file touch-three &&
        test_path_is_file "touch-file  name with spaces" &&
        test_path_is_file touch-after-semicolon &&
 -      test $(git rev-parse master) = $(git rev-parse HEAD) || {
 -              echo "Stopped at wrong revision:"
 -              echo "($(git describe --tags HEAD) instead of master)"
 -              false
 -      } &&
 +      test_cmp_rev master HEAD &&
        rm -f touch-*
  '
  
@@@ -112,7 -117,11 +113,7 @@@ test_expect_success 'rebase -i with th
        export FAKE_LINES &&
        test_must_fail git rebase -i HEAD^
        ) &&
 -      test $(git rev-parse master^) = $(git rev-parse HEAD) || {
 -              echo "Stopped at wrong revision:"
 -              echo "($(git describe --tags HEAD) instead of master^)"
 -              false
 -      } &&
 +      test_cmp_rev master^ HEAD &&
        git reset --hard &&
        git rebase --continue
  '
@@@ -576,7 -585,7 +577,7 @@@ test_expect_success 'do "noop" when the
  
        git checkout -b branch4 HEAD &&
        GIT_EDITOR=: git commit --amend \
 -              --author="Somebody else <somebody@else.com>" 
 +              --author="Somebody else <somebody@else.com>" &&
        test $(git rev-parse branch3) != $(git rev-parse branch4) &&
        git rebase -i branch3 &&
        test $(git rev-parse branch3) = $(git rev-parse branch4)
@@@ -591,7 -600,7 +592,7 @@@ test_expect_success 'submodule rebase s
                git add elif && git commit -m "submodule initial"
        ) &&
        echo 1 >file1 &&
 -      git add file1 sub
 +      git add file1 sub &&
        test_tick &&
        git commit -m "One" &&
        echo 2 >file1 &&
@@@ -647,7 -656,6 +648,7 @@@ test_expect_success 'rebase -i can cop
  
  cat >expect <<EOF
  an earlier note
 +
  a note
  EOF