From c8bae7493d2f2910b57f13ded012e86bdcfb0532 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 16:47:53 +0200 Subject: Adding upstream version 1:2.39.2. Signed-off-by: Daniel Baumann --- t/t9304-fast-import-marks.sh | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 t/t9304-fast-import-marks.sh (limited to 't/t9304-fast-import-marks.sh') diff --git a/t/t9304-fast-import-marks.sh b/t/t9304-fast-import-marks.sh new file mode 100755 index 0000000..a98ef03 --- /dev/null +++ b/t/t9304-fast-import-marks.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +test_description='test exotic situations with marks' +. ./test-lib.sh + +test_expect_success 'setup dump of basic history' ' + test_commit one && + git fast-export --export-marks=marks HEAD >dump +' + +test_expect_success 'setup large marks file' ' + # normally a marks file would have a lot of useful, unique + # marks. But for our purposes, just having a lot of nonsense + # ones is fine. Start at 1024 to avoid clashing with marks + # legitimately used in our tiny dump. + blob=$(git rev-parse HEAD:one.t) && + for i in $(test_seq 1024 16384) + do + echo ":$i $blob" || return 1 + done >>marks +' + +test_expect_success 'import with large marks file' ' + git fast-import --import-marks=marks dump +' + +test_expect_success 'setup submodule mapping with large id' ' + old=$(git rev-parse HEAD:sub) && + new=$(echo $old | sed s/./a/g) && + echo ":12345 $old" >from && + echo ":12345 $new" >to +' + +test_expect_success 'import with submodule mapping' ' + git init dst && + git -C dst fast-import \ + --rewrite-submodules-from=sub:../from \ + --rewrite-submodules-to=sub:../to \ + actual && + echo "$new" >expect && + test_cmp expect actual +' + +test_done -- cgit v1.2.3