Skip to content

Commit

Permalink
Merge branch 'di/fast-import-doc'
Browse files Browse the repository at this point in the history
* di/fast-import-doc:
  doc/fast-import: document feature import-marks-if-exists
  • Loading branch information
Junio C Hamano committed Aug 25, 2011
2 parents 7abd8fb + 3beb4fc commit 1d21112
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Documentation/git-fast-import.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1012,10 +1012,14 @@ force::
(see OPTIONS, above).

import-marks::
import-marks-if-exists::
Like --import-marks except in two respects: first, only one
"feature import-marks" command is allowed per stream;
second, an --import-marks= command-line option overrides
any "feature import-marks" command in the stream.
"feature import-marks" or "feature import-marks-if-exists"
command is allowed per stream; second, an --import-marks=
or --import-marks-if-exists command-line option overrides
any of these "feature" commands in the stream; third,
"feature import-marks-if-exists" like a corresponding
command-line option silently skips a nonexistent file.

cat-blob::
ls::
Expand Down
47 changes: 47 additions & 0 deletions t/t9300-fast-import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,53 @@ test_expect_success 'R: --import-marks-if-exists' '
test_cmp expect io.marks
'

test_expect_success 'R: feature import-marks-if-exists' '
rm -f io.marks &&
>expect &&
git fast-import --export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=not_io.marks
EOF
test_cmp expect io.marks &&
blob=$(echo hi | git hash-object --stdin) &&
echo ":1 $blob" >io.marks &&
echo ":1 $blob" >expect &&
echo ":2 $blob" >>expect &&
git fast-import --export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=io.marks
blob
mark :2
data 3
hi
EOF
test_cmp expect io.marks &&
echo ":3 $blob" >>expect &&
git fast-import --import-marks=io.marks \
--export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=not_io.marks
blob
mark :3
data 3
hi
EOF
test_cmp expect io.marks &&
>expect &&
git fast-import --import-marks-if-exists=not_io.marks \
--export-marks=io.marks <<-\EOF
feature import-marks-if-exists=io.marks
EOF
test_cmp expect io.marks
'

cat >input << EOF
feature import-marks=marks.out
feature export-marks=marks.new
Expand Down

0 comments on commit 1d21112

Please sign in to comment.