summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2022-03-14 07:42:51 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-03-14 22:25:13 (GMT)
commita2565c48e410864c049e66a64393fd6e26eb9a55 (patch)
treea0f0f3d13bc97b60d63ca4b02298ce9ff8aaad6f /t
parent64a6151da7fa4b36eb2818047a9b76797e25b46e (diff)
downloadgit-a2565c48e410864c049e66a64393fd6e26eb9a55.zip
git-a2565c48e410864c049e66a64393fd6e26eb9a55.tar.gz
git-a2565c48e410864c049e66a64393fd6e26eb9a55.tar.bz2
repack: add config to skip updating server info
By default, git-repack(1) will update server info that is required by the dumb HTTP transport. This can be skipped by passing the `-n` flag, but what we're noticably missing is a config option to permanently disable updating this information. Add a new option "repack.updateServerInfo" which can be used to disable the logic. Most hosting providers have turned off the dumb HTTP protocol anyway, and on the client-side it woudln't typically be useful either. Giving a persistent way to disable this feature thus makes quite some sense to avoid wasting compute cycles and storage. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7700-repack.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 7327047..a2f52a3 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -417,4 +417,22 @@ test_expect_success '-n skips updating server info' '
test_server_info_missing
'
+test_expect_success 'repack.updateServerInfo=true updates server info' '
+ test_server_info_cleanup &&
+ git -C update-server-info -c repack.updateServerInfo=true repack &&
+ test_server_info_present
+'
+
+test_expect_success 'repack.updateServerInfo=false skips updating server info' '
+ test_server_info_cleanup &&
+ git -C update-server-info -c repack.updateServerInfo=false repack &&
+ test_server_info_missing
+'
+
+test_expect_success '-n overrides repack.updateServerInfo=true' '
+ test_server_info_cleanup &&
+ git -C update-server-info -c repack.updateServerInfo=true repack -n &&
+ test_server_info_missing
+'
+
test_done