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
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-24 00:09:30 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-24 00:09:30 +0300
commitbfce3e7b9290a8fe8c4ffc97d6b1e60e041db4f1 (patch)
tree09dfb2333e77c6813e03e6d7ed0b9eb9ae76dafe /t/t7700-repack.sh
parentecb939a9ce84a25c2ef833747d1a5abed571c37d (diff)
parenta2565c48e410864c049e66a64393fd6e26eb9a55 (diff)
Merge branch 'ps/repack-with-server-info'
"git repack" learned a new configuration to disable triggering of age-old "update-server-info" command, which is rarely useful these days. * ps/repack-with-server-info: repack: add config to skip updating server info repack: refactor to avoid double-negation of update-server-info
Diffstat (limited to 't/t7700-repack.sh')
-rwxr-xr-xt/t7700-repack.sh50
1 files changed, 50 insertions, 0 deletions
diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh
index 5922fb5bdd..770d143204 100755
--- a/t/t7700-repack.sh
+++ b/t/t7700-repack.sh
@@ -381,4 +381,54 @@ test_expect_success TTY '--quiet disables progress' '
test_must_be_empty stderr
'
+test_expect_success 'setup for update-server-info' '
+ git init update-server-info &&
+ test_commit -C update-server-info message
+'
+
+test_server_info_present () {
+ test_path_is_file update-server-info/.git/objects/info/packs &&
+ test_path_is_file update-server-info/.git/info/refs
+}
+
+test_server_info_missing () {
+ test_path_is_missing update-server-info/.git/objects/info/packs &&
+ test_path_is_missing update-server-info/.git/info/refs
+}
+
+test_server_info_cleanup () {
+ rm -f update-server-info/.git/objects/info/packs update-server-info/.git/info/refs &&
+ test_server_info_missing
+}
+
+test_expect_success 'updates server info by default' '
+ test_server_info_cleanup &&
+ git -C update-server-info repack &&
+ test_server_info_present
+'
+
+test_expect_success '-n skips updating server info' '
+ test_server_info_cleanup &&
+ git -C update-server-info repack -n &&
+ 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