summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Sverre Rabbelier <srabbelier@gmail.com>2009-12-04 18:06:59 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-12-04 16:10:59 -0800
commit081751c882f8398081b94335faa23912a655fb1c (patch)
tree3da0cea4682608beabbd36e0075a15e59d789bbc /t
parentfast-import: test the new option command (diff)
downloadtgif-081751c882f8398081b94335faa23912a655fb1c.tar.xz
fast-import: allow for multiple --import-marks= arguments
The --import-marks= option may be specified multiple times on the commandline and should result in all marks being read in. Only one import-marks feature may be specified in the stream, which is overriden by any --import-marks= commandline options. If one wishes to specify import-marks files in addition to the one specified in the stream, it is easy to repeat the stream option as a --import-marks= commandline option. Also verify this behavior with tests. Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9300-fast-import.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 74dff1183d..ba92775b9d 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -1286,6 +1286,15 @@ test_expect_success 'R: abort on receiving feature after data command' '
'
cat >input << EOF
+feature import-marks=git.marks
+feature import-marks=git2.marks
+EOF
+
+test_expect_success 'R: only one import-marks feature allowed per stream' '
+ test_must_fail git fast-import <input
+'
+
+cat >input << EOF
feature export-marks=git.marks
blob
mark :1
@@ -1324,6 +1333,19 @@ test_expect_success \
'cat input | git fast-import --import-marks=marks.out &&
test_cmp marks.out marks.new'
+
+cat >input <<EOF
+feature import-marks=nonexistant.marks
+feature export-marks=combined.marks
+EOF
+
+test_expect_success 'R: multiple --import-marks= should be honoured' '
+ head -n2 marks.out > one.marks &&
+ tail -n +3 marks.out > two.marks &&
+ git fast-import --import-marks=one.marks --import-marks=two.marks <input &&
+ test_cmp marks.out combined.marks
+'
+
cat >input << EOF
option git quiet
blob