summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-09-29 21:01:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-09-29 21:01:20 (GMT)
commitb28919c7bcfabad81896070e6b7b66be8310e6a8 (patch)
tree304d19a2c97a33b316271952c1429163ace95438 /t
parent288ed98bf768f4df9b569d51a52c233a1402c0f5 (diff)
parent47ac970309dc26c95c4de4991b2e6aa7c7b7f615 (diff)
downloadgit-b28919c7bcfabad81896070e6b7b66be8310e6a8.zip
git-b28919c7bcfabad81896070e6b7b66be8310e6a8.tar.gz
git-b28919c7bcfabad81896070e6b7b66be8310e6a8.tar.bz2
Merge branch 'bc/clone-with-git-default-hash-fix'
"git clone" that clones from SHA-1 repository, while GIT_DEFAULT_HASH set to use SHA-256 already, resulted in an unusable repository that half-claims to be SHA-256 repository with SHA-1 objects and refs. This has been corrected. * bc/clone-with-git-default-hash-fix: builtin/clone: avoid failure with GIT_DEFAULT_HASH
Diffstat (limited to 't')
-rwxr-xr-xt/t5601-clone.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh
index 15fb64c..b6c8312 100755
--- a/t/t5601-clone.sh
+++ b/t/t5601-clone.sh
@@ -631,6 +631,20 @@ test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' '
test_i18ngrep "the following paths have collided" icasefs/warning
'
+test_expect_success 'clone with GIT_DEFAULT_HASH' '
+ (
+ sane_unset GIT_DEFAULT_HASH &&
+ git init --object-format=sha1 test-sha1 &&
+ git init --object-format=sha256 test-sha256
+ ) &&
+ test_commit -C test-sha1 foo &&
+ test_commit -C test-sha256 foo &&
+ GIT_DEFAULT_HASH=sha1 git clone test-sha256 test-clone-sha256 &&
+ GIT_DEFAULT_HASH=sha256 git clone test-sha1 test-clone-sha1 &&
+ git -C test-clone-sha1 status &&
+ git -C test-clone-sha256 status
+'
+
partial_clone_server () {
SERVER="$1" &&