Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-25 00:54:31 +0300
committerJunio C Hamano <gitster@pobox.com>2020-08-25 00:54:31 +0300
commitb55605073381a9863b3c2b3b6627122fe9b90453 (patch)
tree46ef750609127c8e3c427f5bfad478a0f4e394e7 /t
parentd1ff7411f3538812796048e8f5bba717bb79fa2f (diff)
parent887952b8c680626f4721cb5fa57704478801aca4 (diff)
Merge branch 'jc/no-update-fetch-head'
"git fetch" learned --no-write-fetch-head option to avoid writing the FETCH_HEAD file. * jc/no-update-fetch-head: fetch: optionally allow disabling FETCH_HEAD update
Diffstat (limited to 't')
-rwxr-xr-xt/t5510-fetch.sh15
-rwxr-xr-xt/t5521-pull-options.sh7
2 files changed, 20 insertions, 2 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 25695dfe22..2a1abe91f0 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -543,13 +543,24 @@ test_expect_success 'fetch into the current branch with --update-head-ok' '
'
-test_expect_success 'fetch --dry-run' '
-
+test_expect_success 'fetch --dry-run does not touch FETCH_HEAD' '
rm -f .git/FETCH_HEAD &&
git fetch --dry-run . &&
! test -f .git/FETCH_HEAD
'
+test_expect_success '--no-write-fetch-head does not touch FETCH_HEAD' '
+ rm -f .git/FETCH_HEAD &&
+ git fetch --no-write-fetch-head . &&
+ ! test -f .git/FETCH_HEAD
+'
+
+test_expect_success '--write-fetch-head gets defeated by --dry-run' '
+ rm -f .git/FETCH_HEAD &&
+ git fetch --dry-run --write-fetch-head . &&
+ ! test -f .git/FETCH_HEAD
+'
+
test_expect_success "should be able to fetch with duplicate refspecs" '
mkdir dups &&
(
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index 159afa7ac8..db1a381cd9 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -85,6 +85,13 @@ test_expect_success 'git pull --cleanup errors early on invalid argument' '
test -s err)
'
+test_expect_success 'git pull --no-write-fetch-head fails' '
+ mkdir clonedwfh &&
+ (cd clonedwfh && git init &&
+ test_expect_code 129 git pull --no-write-fetch-head "../parent" >out 2>err &&
+ test_must_be_empty out &&
+ test_i18ngrep "no-write-fetch-head" err)
+'
test_expect_success 'git pull --force' '
mkdir clonedoldstyle &&