aboutsummaryrefslogtreecommitdiff
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-12-04 21:58:42 -0800
committerJunio C Hamano <gitster@pobox.com>2007-12-04 21:58:42 -0800
commitc7015961998a2061ad57a2a83ead009443d912f0 (patch)
treed950d59122314d989ae9fee82a7c40f4cea9fa41 /t/t5510-fetch.sh
parentab7d70766963e1e854a1edcbb0b840242330a7cb (diff)
downloadgit-c7015961998a2061ad57a2a83ead009443d912f0.tar.gz
git-c7015961998a2061ad57a2a83ead009443d912f0.tar.xz
t5510: add a bit more tests for fetch
"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>
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 46a9c4d95..02882c1e4 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -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