diff options
author | Patrick Steinhardt <ps@pks.im> | 2023-12-29 10:27:09 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-01-02 20:24:48 +0300 |
commit | 5ed860f51b7fa1ca1087c1b0502b199a86db964e (patch) | |
tree | cefe14b8afb2b271b9c2fce10b0a73fd5b0c818e /t | |
parent | 48fa45f5fb80de821a380a7ff81ab2c568d69e35 (diff) |
builtin/clone: introduce `--ref-format=` value flag
Introduce a new `--ref-format` value flag for git-clone(1) that allows
the user to specify the ref format that is to be used for a newly
initialized repository.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5601-clone.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 47eae641f0..fb1b9c686d 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -157,6 +157,23 @@ test_expect_success 'clone --mirror does not repeat tags' ' ' +test_expect_success 'clone with files ref format' ' + test_when_finished "rm -rf ref-storage" && + git clone --ref-format=files --mirror src ref-storage && + echo files >expect && + git -C ref-storage rev-parse --show-ref-format >actual && + test_cmp expect actual +' + +test_expect_success 'clone with garbage ref format' ' + cat >expect <<-EOF && + fatal: unknown ref storage format ${SQ}garbage${SQ} + EOF + test_must_fail git clone --ref-format=garbage --mirror src ref-storage 2>err && + test_cmp expect err && + test_path_is_missing ref-storage +' + test_expect_success 'clone to destination with trailing /' ' git clone src target-1/ && |