summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-06-20 20:14:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-20 20:14:10 (GMT)
commita668853c6715b481bff347d7a08f5d885fc95f86 (patch)
tree0c3dd44c39d7ef3f55896e93b2a7a1100579f77a /t
parent9fe49ae7d7750297680442bcee8cd13959303247 (diff)
parentdb4e4113ea33ece52c5988f9b9f7c0559c802602 (diff)
downloadgit-a668853c6715b481bff347d7a08f5d885fc95f86.zip
git-a668853c6715b481bff347d7a08f5d885fc95f86.tar.gz
git-a668853c6715b481bff347d7a08f5d885fc95f86.tar.bz2
Merge branch 'jc/fetch-pull-refmap'
* jc/fetch-pull-refmap: docs: Explain the purpose of fetch's and pull's <refspec> parameter. fetch: allow explicit --refmap to override configuration fetch doc: add a section on configured remote-tracking branches fetch doc: remove "short-cut" section fetch doc: update refspec format description fetch doc: on pulling multiple refspecs fetch doc: remove notes on outdated "mixed layout" fetch doc: update note on '+' in front of the refspec fetch doc: move FETCH_HEAD material lower and add an example fetch doc: update introductory part for clarity
Diffstat (limited to 't')
-rwxr-xr-xt/t5510-fetch.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 29d59ef..d78f320 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -447,6 +447,43 @@ test_expect_success 'explicit pull should update tracking' '
)
'
+test_expect_success 'explicit --refmap is allowed only with command-line refspec' '
+ cd "$D" &&
+ (
+ cd three &&
+ test_must_fail git fetch --refmap="*:refs/remotes/none/*"
+ )
+'
+
+test_expect_success 'explicit --refmap option overrides remote.*.fetch' '
+ cd "$D" &&
+ git branch -f side &&
+ (
+ cd three &&
+ git update-ref refs/remotes/origin/master base-origin-master &&
+ o=$(git rev-parse --verify refs/remotes/origin/master) &&
+ git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master &&
+ n=$(git rev-parse --verify refs/remotes/origin/master) &&
+ test "$o" = "$n" &&
+ test_must_fail git rev-parse --verify refs/remotes/origin/side &&
+ git rev-parse --verify refs/remotes/other/master
+ )
+'
+
+test_expect_success 'explicitly empty --refmap option disables remote.*.fetch' '
+ cd "$D" &&
+ git branch -f side &&
+ (
+ cd three &&
+ git update-ref refs/remotes/origin/master base-origin-master &&
+ o=$(git rev-parse --verify refs/remotes/origin/master) &&
+ git fetch --refmap="" origin master &&
+ n=$(git rev-parse --verify refs/remotes/origin/master) &&
+ test "$o" = "$n" &&
+ test_must_fail git rev-parse --verify refs/remotes/origin/side
+ )
+'
+
test_expect_success 'configured fetch updates tracking' '
cd "$D" &&