Skip to content

Commit

Permalink
t5510: add a bit more tests for fetch
Browse files Browse the repository at this point in the history
"git pull/fetch" that gets explicit refspecs from the command line should
not update configured tracking refs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Dec 5, 2007
1 parent ab7d707 commit c701596
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions t/t5510-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,46 @@ test_expect_success 'bundle should record HEAD correctly' '
'

test_expect_success 'explicit fetch should not update tracking' '
cd "$D" &&
git branch -f side &&
(
cd three &&
o=$(git rev-parse --verify refs/remotes/origin/master) &&
git fetch origin master &&
n=$(git rev-parse --verify refs/remotes/origin/master) &&
test "$o" = "$n" &&
! git rev-parse --verify refs/remotes/origin/side
)
'

test_expect_success 'explicit pull should not update tracking' '
cd "$D" &&
git branch -f side &&
(
cd three &&
o=$(git rev-parse --verify refs/remotes/origin/master) &&
git pull origin master &&
n=$(git rev-parse --verify refs/remotes/origin/master) &&
test "$o" = "$n" &&
! git rev-parse --verify refs/remotes/origin/side
)
'

test_expect_success 'configured fetch updates tracking' '
cd "$D" &&
git branch -f side &&
(
cd three &&
o=$(git rev-parse --verify refs/remotes/origin/master) &&
git fetch origin &&
n=$(git rev-parse --verify refs/remotes/origin/master) &&
test "$o" != "$n" &&
git rev-parse --verify refs/remotes/origin/side
)
'

test_done

0 comments on commit c701596

Please sign in to comment.