Merge branch 'js/close-packs-before-gc'
authorJunio C Hamano <gitster@pobox.com>
Thu, 10 Mar 2016 18:56:42 +0000 (10:56 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Mar 2016 18:56:42 +0000 (10:56 -0800)
A small future-proofing of a test added recently.

* js/close-packs-before-gc:
t5510: do not leave changed cwd

1  2 
t/t5510-fetch.sh
diff --combined t/t5510-fetch.sh
index 0c10c856a96072a1b0c37530a9f5c8605d8833b5,5b52c877c3914b13629b2fd775ee45812e6facb5..38321d19efbee0da62a9327f5849521093fbe077
@@@ -7,7 -7,7 +7,7 @@@ test_description='Per branch config var
  
  . ./test-lib.sh
  
 -D=`pwd`
 +D=$(pwd)
  
  test_bundle_object_count () {
        git verify-pack -v "$1" >verify.out &&
@@@ -64,8 -64,8 +64,8 @@@ test_expect_success "fetch test" 
        cd two &&
        git fetch &&
        test -f .git/refs/heads/one &&
 -      mine=`git rev-parse refs/heads/one` &&
 -      his=`cd ../one && git rev-parse refs/heads/master` &&
 +      mine=$(git rev-parse refs/heads/one) &&
 +      his=$(cd ../one && git rev-parse refs/heads/master) &&
        test "z$mine" = "z$his"
  '
  
@@@ -75,8 -75,8 +75,8 @@@ test_expect_success "fetch test for-mer
        git fetch &&
        test -f .git/refs/heads/two &&
        test -f .git/refs/heads/one &&
 -      master_in_two=`cd ../two && git rev-parse master` &&
 -      one_in_two=`cd ../two && git rev-parse one` &&
 +      master_in_two=$(cd ../two && git rev-parse master) &&
 +      one_in_two=$(cd ../two && git rev-parse one) &&
        {
                echo "$one_in_two       "
                echo "$master_in_two    not-for-merge"
@@@ -314,6 -314,42 +314,6 @@@ test_expect_success 'bundle should be a
  
  '
  
 -! rsync --help > /dev/null 2> /dev/null &&
 -say 'Skipping rsync tests because rsync was not found' || {
 -test_expect_success 'fetch via rsync' '
 -      git pack-refs &&
 -      mkdir rsynced &&
 -      (cd rsynced &&
 -       git init --bare &&
 -       git fetch "rsync:../.git" master:refs/heads/master &&
 -       git gc --prune &&
 -       test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
 -       git fsck --full)
 -'
 -
 -test_expect_success 'push via rsync' '
 -      mkdir rsynced2 &&
 -      (cd rsynced2 &&
 -       git init) &&
 -      (cd rsynced &&
 -       git push "rsync:../rsynced2/.git" master) &&
 -      (cd rsynced2 &&
 -       git gc --prune &&
 -       test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
 -       git fsck --full)
 -'
 -
 -test_expect_success 'push via rsync' '
 -      mkdir rsynced3 &&
 -      (cd rsynced3 &&
 -       git init) &&
 -      git push --all "rsync:rsynced3/.git" &&
 -      (cd rsynced3 &&
 -       test $(git rev-parse master) = $(cd .. && git rev-parse master) &&
 -       git fsck --full)
 -'
 -}
 -
  test_expect_success 'fetch with a non-applying branch.<name>.merge' '
        git config branch.master.remote yeti &&
        git config branch.master.merge refs/heads/bigfoot &&
@@@ -679,10 -715,12 +679,12 @@@ test_expect_success 'fetching with auto
        EOF
        git clone "file://$D" auto-gc &&
        test_commit test2 &&
-       cd auto-gc &&
-       git config gc.autoPackLimit 1 &&
-       GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
-       ! grep "Should I try again" fetch.out
+       (
+               cd auto-gc &&
+               git config gc.autoPackLimit 1 &&
+               GIT_ASK_YESNO="$D/askyesno" git fetch >fetch.out 2>&1 &&
+               ! grep "Should I try again" fetch.out
+       )
  '
  
  test_done