diff options
author | 2020-09-29 14:01:20 -0700 | |
---|---|---|
committer | 2020-09-29 14:01:20 -0700 | |
commit | b28919c7bcfabad81896070e6b7b66be8310e6a8 (patch) | |
tree | 304d19a2c97a33b316271952c1429163ace95438 /t | |
parent | Merge branch 'tb/bloom-improvements' (diff) | |
parent | builtin/clone: avoid failure with GIT_DEFAULT_HASH (diff) | |
download | tgif-b28919c7bcfabad81896070e6b7b66be8310e6a8.tar.xz |
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-x | t/t5601-clone.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 15fb64c18d..b6c8312da1 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" && |