]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5510-fetch.sh
fetch: optionally allow disabling FETCH_HEAD update
[thirdparty/git.git] / t / t5510-fetch.sh
index 25695dfe2232ef3d1ce54ef0eedec2b9fe51b3da..2a1abe91f0fd34b7929aa636ab43542c6e45ea54 100755 (executable)
@@ -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 &&
        (