]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t0410-partial-clone.sh
fetch: no FETCH_HEAD display if --no-write-fetch-head
[thirdparty/git.git] / t / t0410-partial-clone.sh
index 6aa0f313bddbc9df06d22d10c1cb59a8b92e8e89..584a039b851dbbf727d35d469e7d05895f9ec4e8 100755 (executable)
@@ -42,7 +42,7 @@ test_expect_success 'convert shallow clone to partial clone' '
        test_cmp_config -C client 1 core.repositoryformatversion
 '
 
-test_expect_success 'convert to partial clone with noop extension' '
+test_expect_success SHA1 'convert to partial clone with noop extension' '
        rm -fr server client &&
        test_create_repo server &&
        test_commit -C server my_commit 1 &&
@@ -53,7 +53,7 @@ test_expect_success 'convert to partial clone with noop extension' '
        git -C client fetch --unshallow --filter="blob:none"
 '
 
-test_expect_success 'converting to partial clone fails with unrecognized extension' '
+test_expect_success SHA1 'converting to partial clone fails with unrecognized extension' '
        rm -fr server client &&
        test_create_repo server &&
        test_commit -C server my_commit 1 &&
@@ -183,7 +183,7 @@ test_expect_success 'missing CLI object, but promised, passes fsck' '
 '
 
 test_expect_success 'fetching of missing objects' '
-       rm -rf repo &&
+       rm -rf repo err &&
        test_create_repo server &&
        test_commit -C server foo &&
        git -C server repack -a -d --write-bitmap-index &&
@@ -194,7 +194,10 @@ test_expect_success 'fetching of missing objects' '
 
        git -C repo config core.repositoryformatversion 1 &&
        git -C repo config extensions.partialclone "origin" &&
-       git -C repo cat-file -p "$HASH" &&
+       git -C repo cat-file -p "$HASH" 2>err &&
+
+       # Ensure that no spurious FETCH_HEAD messages are written
+       ! grep FETCH_HEAD err &&
 
        # Ensure that the .promisor file is written, and check that its
        # associated packfile contains the object
@@ -214,7 +217,7 @@ test_expect_success 'fetching of missing objects works with ref-in-want enabled'
        rm -rf repo/.git/objects/* &&
        rm -f trace &&
        GIT_TRACE_PACKET="$(pwd)/trace" git -C repo cat-file -p "$HASH" &&
-       grep "git< fetch=.*ref-in-want" trace
+       grep "fetch< fetch=.*ref-in-want" trace
 '
 
 test_expect_success 'fetching of missing objects from another promisor remote' '