]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t5510-fetch.sh
fetch: add fetch.writeCommitGraph config setting
[thirdparty/git.git] / t / t5510-fetch.sh
index e98d90dd9baf644bf2013aea51a91eab4e9ef73c..91ede622f033c7cced55bd397c55cc2f554225ff 100755 (executable)
@@ -570,6 +570,19 @@ test_expect_success 'LHS of refspec follows ref disambiguation rules' '
        )
 '
 
+test_expect_success 'fetch.writeCommitGraph' '
+       git clone three write &&
+       (
+               cd three &&
+               test_commit new
+       ) &&
+       (
+               cd write &&
+               git -c fetch.writeCommitGraph fetch origin &&
+               test_path_is_file .git/objects/info/commit-graphs/commit-graph-chain
+       )
+'
+
 # configured prune tests
 
 set_config_tristate () {
@@ -978,4 +991,27 @@ test_expect_success '--negotiation-tip limits "have" lines sent with HTTP protoc
        check_negotiation_tip
 '
 
+test_expect_success '--no-show-forced-updates' '
+       mkdir forced-updates &&
+       (
+               cd forced-updates &&
+               git init &&
+               test_commit 1 &&
+               test_commit 2
+       ) &&
+       git clone forced-updates forced-update-clone &&
+       git clone forced-updates no-forced-update-clone &&
+       git -C forced-updates reset --hard HEAD~1 &&
+       (
+               cd forced-update-clone &&
+               git fetch --show-forced-updates origin 2>output &&
+               test_i18ngrep "(forced update)" output
+       ) &&
+       (
+               cd no-forced-update-clone &&
+               git fetch --no-show-forced-updates origin 2>output &&
+               ! test_i18ngrep "(forced update)" output
+       )
+'
+
 test_done