aboutsummaryrefslogtreecommitdiffstats
path: root/t/t0410-partial-clone.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t0410-partial-clone.sh')
-rwxr-xr-xt/t0410-partial-clone.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh
index 88a66f0904..2c30c86e7b 100755
--- a/t/t0410-partial-clone.sh
+++ b/t/t0410-partial-clone.sh
@@ -3,6 +3,7 @@
test_description='partial clone'
. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-terminal.sh
# missing promisor objects cause repacks which write bitmaps to fail
GIT_TEST_MULTI_PACK_INDEX_WRITE_BITMAP=0
@@ -689,6 +690,67 @@ test_expect_success 'lazy-fetch when accessing object not in the_repository' '
! grep "[?]$FILE_HASH" out
'
+test_expect_success 'push should not fetch new commit objects' '
+ rm -rf server client &&
+ test_create_repo server &&
+ test_config -C server uploadpack.allowfilter 1 &&
+ test_config -C server uploadpack.allowanysha1inwant 1 &&
+ test_commit -C server server1 &&
+
+ git clone --filter=blob:none "file://$(pwd)/server" client &&
+ test_commit -C client client1 &&
+
+ test_commit -C server server2 &&
+ COMMIT=$(git -C server rev-parse server2) &&
+
+ test_must_fail git -C client push 2>err &&
+ grep "fetch first" err &&
+ git -C client rev-list --objects --missing=print "$COMMIT" >objects &&
+ grep "^[?]$COMMIT" objects
+'
+
+test_expect_success 'setup for promisor.quiet tests' '
+ rm -rf server &&
+ test_create_repo server &&
+ test_commit -C server foo &&
+ git -C server rm foo.t &&
+ git -C server commit -m remove &&
+ git -C server config uploadpack.allowanysha1inwant 1 &&
+ git -C server config uploadpack.allowfilter 1
+'
+
+test_expect_success TTY 'promisor.quiet=false shows progress messages' '
+ rm -rf repo &&
+ git clone --filter=blob:none "file://$(pwd)/server" repo &&
+ git -C repo config promisor.quiet "false" &&
+
+ test_terminal git -C repo cat-file -p foo:foo.t 2>err &&
+
+ # Ensure that progress messages are written
+ grep "Receiving objects" err
+'
+
+test_expect_success TTY 'promisor.quiet=true does not show progress messages' '
+ rm -rf repo &&
+ git clone --filter=blob:none "file://$(pwd)/server" repo &&
+ git -C repo config promisor.quiet "true" &&
+
+ test_terminal git -C repo cat-file -p foo:foo.t 2>err &&
+
+ # Ensure that no progress messages are written
+ ! grep "Receiving objects" err
+'
+
+test_expect_success TTY 'promisor.quiet=unconfigured shows progress messages' '
+ rm -rf repo &&
+ git clone --filter=blob:none "file://$(pwd)/server" repo &&
+
+ test_terminal git -C repo cat-file -p foo:foo.t 2>err &&
+
+ # Ensure that progress messages are written
+ grep "Receiving objects" err
+'
+
. "$TEST_DIRECTORY"/lib-httpd.sh
start_httpd