Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2016-05-18 00:40:23 +0300
committerJunio C Hamano <gitster@pobox.com>2016-05-18 01:02:25 +0300
commitf4beed60d5ef3fdbd31ac5bd3162182fdf2bf0d3 (patch)
tree4a7539abe7a7b8c0524f39b17ac1e8cf3e868300 /t
parentd92347f59fefb95a2d9240c007a44f408c216fa7 (diff)
fast-import: do not truncate exported marks file
Certain lines of the marks file might be corrupted (or the objects missing due to a garbage collection), but that's no reason to truncate the file and essentially destroy the rest of it. Ideally missing objects should not cause a crash, we could just skip them, but that's another patch. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9300-fast-import.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 25bb60b281..4bca35c259 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -2650,6 +2650,21 @@ test_expect_success 'R: ignore non-git options' '
git fast-import <input
'
+test_expect_success 'R: corrupt lines do not mess marks file' '
+ rm -f io.marks &&
+ blob=$(echo hi | git hash-object --stdin) &&
+ cat >expect <<-EOF &&
+ :3 0000000000000000000000000000000000000000
+ :1 $blob
+ :2 $blob
+ EOF
+ cp expect io.marks &&
+ test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF &&
+
+ EOF
+ test_cmp expect io.marks
+'
+
##
## R: very large blobs
##