aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-11 13:49:13 -0700
committerJunio C Hamano <gitster@pobox.com>2023-04-11 13:49:13 -0700
commit96f4113ac01e3d8e4a26cbc4df18d0af958c1710 (patch)
treef814e43f5b3246f7715f162ff05188e79cbeb5dc /t
parenta86083e25fa3cb1d769f029d06b2b53a52f2531b (diff)
parent8b214c2e9dda8fc5b8d49b978fd2c155b7596cd0 (diff)
downloadgit-96f4113ac01e3d8e4a26cbc4df18d0af958c1710.tar.gz
Merge branch 'jc/clone-object-format-from-void'
"git clone" from an empty repository learned to propagate the choice of the hash algorithm from the source repository to the newly created repository. * jc/clone-object-format-from-void: clone: propagate object-format when cloning from void
Diffstat (limited to 't')
-rwxr-xr-xt/t5702-protocol-v2.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh
index 71aabe30b7..6af5c2062f 100755
--- a/t/t5702-protocol-v2.sh
+++ b/t/t5702-protocol-v2.sh
@@ -269,6 +269,17 @@ test_expect_success 'clone propagates unborn HEAD from non-empty repo' '
grep "warning: remote HEAD refers to nonexistent ref" stderr
'
+test_expect_success 'clone propagates object-format from empty repo' '
+ test_when_finished "rm -fr src256 dst256" &&
+
+ echo sha256 >expect &&
+ git init --object-format=sha256 src256 &&
+ git clone src256 dst256 &&
+ git -C dst256 rev-parse --show-object-format >actual &&
+
+ test_cmp expect actual
+'
+
test_expect_success 'bare clone propagates unborn HEAD from non-empty repo' '
test_when_finished "rm -rf file_unborn_parent file_unborn_child.git" &&