An annotated tag that annotates a blob.
EOF
+ tag to-be-deleted
+ from :3
+ data <<EOF
+ Another annotated tag that annotates a blob.
+ EOF
+
+ reset refs/tags/to-be-deleted
+ from 0000000000000000000000000000000000000000
+
+ tag nested
+ mark :6
+ from :4
+ data <<EOF
+ Tag of our lovely commit
+ EOF
+
+ reset refs/tags/nested
+ from 0000000000000000000000000000000000000000
+
+ tag nested
+ mark :7
+ from :6
+ data <<EOF
+ Tag of tag of our lovely commit
+ EOF
+
+ alias
+ mark :8
+ to :5
+
INPUT_END
git fast-import --export-marks=marks.out <input &&
git whatchanged master
test_cmp expect actual
'
+test_expect_success 'A: verify tag deletion is successful' '
+ test_must_fail git rev-parse --verify refs/tags/to-be-deleted
+'
+
test_expect_success 'A: verify marks output' '
cat >expect <<-EOF &&
:2 $(git rev-parse --verify master:file2)
:3 $(git rev-parse --verify master:file3)
:4 $(git rev-parse --verify master:file4)
:5 $(git rev-parse --verify master^0)
+ :6 $(git cat-file tag nested | grep object | cut -d" " -f 2)
+ :7 $(git rev-parse --verify nested)
+ :8 $(git rev-parse --verify master^0)
EOF
test_cmp expect marks.out
'
test_must_fail git fast-import <input
'
-test_expect_success 'R: import-marks features forbidden by default' '
- >git.marks &&
- echo "feature import-marks=git.marks" >input &&
- test_must_fail git fast-import <input &&
- echo "feature import-marks-if-exists=git.marks" >input &&
- test_must_fail git fast-import <input
-'
-
test_expect_success 'R: only one import-marks feature allowed per stream' '
- >git.marks &&
- >git2.marks &&
cat >input <<-EOF &&
feature import-marks=git.marks
feature import-marks=git2.marks
EOF
- test_must_fail git fast-import --allow-unsafe-features <input
-'
-
-test_expect_success 'R: export-marks feature forbidden by default' '
- echo "feature export-marks=git.marks" >input &&
test_must_fail git fast-import <input
'
EOF
- git fast-import --allow-unsafe-features <input &&
+ cat input | git fast-import &&
grep :1 git.marks
'
test_expect_success 'R: export-marks options can be overridden by commandline options' '
- cat >input <<-\EOF &&
- feature export-marks=feature-sub/git.marks
- blob
- mark :1
- data 3
- hi
-
- EOF
- git fast-import --allow-unsafe-features \
- --export-marks=cmdline-sub/other.marks <input &&
- grep :1 cmdline-sub/other.marks &&
- test_path_is_missing feature-sub
+ cat input | git fast-import --export-marks=other.marks &&
+ grep :1 other.marks
'
test_expect_success 'R: catch typo in marks file name' '
test_must_fail git fast-import --import-marks=nonexistent.marks </dev/null &&
echo "feature import-marks=nonexistent.marks" |
- test_must_fail git fast-import --allow-unsafe-features
+ test_must_fail git fast-import
'
test_expect_success 'R: import and output marks can be the same file' '
test_expect_success 'R: feature import-marks-if-exists' '
rm -f io.marks &&
- git fast-import --export-marks=io.marks \
- --allow-unsafe-features <<-\EOF &&
+ git fast-import --export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=not_io.marks
EOF
test_must_be_empty io.marks &&
echo ":1 $blob" >expect &&
echo ":2 $blob" >>expect &&
- git fast-import --export-marks=io.marks \
- --allow-unsafe-features <<-\EOF &&
+ git fast-import --export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=io.marks
blob
mark :2
echo ":3 $blob" >>expect &&
git fast-import --import-marks=io.marks \
- --export-marks=io.marks \
- --allow-unsafe-features <<-\EOF &&
+ --export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=not_io.marks
blob
mark :3
test_cmp expect io.marks &&
git fast-import --import-marks-if-exists=not_io.marks \
- --export-marks=io.marks \
- --allow-unsafe-features <<-\EOF &&
+ --export-marks=io.marks <<-\EOF &&
feature import-marks-if-exists=io.marks
EOF
test_must_be_empty io.marks
feature export-marks=marks.new
EOF
- git fast-import --allow-unsafe-features <input &&
+ cat input | git fast-import &&
test_cmp marks.out marks.new
'
feature export-marks=marks.new
EOF
- git fast-import --import-marks=marks.out --allow-unsafe-features <input &&
+ cat input | git fast-import --import-marks=marks.out &&
test_cmp marks.out marks.new
'
head -n2 marks.out > one.marks &&
tail -n +3 marks.out > two.marks &&
- git fast-import --import-marks=one.marks --import-marks=two.marks \
- --allow-unsafe-features <input &&
+ git fast-import --import-marks=one.marks --import-marks=two.marks <input &&
test_cmp marks.out combined.marks
'
mkdir -p .git/info/fast-import/ &&
cp marks.new .git/info/fast-import/relative.in &&
- git fast-import --allow-unsafe-features <input &&
+ git fast-import <input &&
test_cmp marks.new .git/info/fast-import/relative.out
'
feature export-marks=non-relative.out
EOF
- git fast-import --allow-unsafe-features <input &&
+ git fast-import <input &&
test_cmp marks.new non-relative.out
'
EOF
- git fast-import 2>output <input &&
+ cat input | git fast-import 2> output &&
test_must_be_empty output
'
COMMIT
M 100644 :403x hello.c
EOF
- cat err &&
test_i18ngrep "space after mark" err
'
inline
BLOB
EOF
- cat err &&
test_i18ngrep "nvalid dataref" err
'
COMMIT
M 100644 ${sha1}x hello.c
EOF
- cat err &&
test_i18ngrep "space after SHA1" err
'
COMMIT
N :202x :302
EOF
- cat err &&
test_i18ngrep "space after mark" err
'
note blob
BLOB
EOF
- cat err &&
test_i18ngrep "nvalid dataref" err
'
COMMIT
N ${sha1}x :302
EOF
- cat err &&
test_i18ngrep "space after SHA1" err
'
COMMIT
N :202 :302x
EOF
- cat err &&
test_i18ngrep "after mark" err
'
EOF
# now evaluate the error
- cat err &&
test_i18ngrep "after mark" err
'
merge :303x
M 100644 :403 hello.c
EOF
- cat err &&
test_i18ngrep "after mark" err
'
tag S
TAG
EOF
- cat err &&
test_i18ngrep "after mark" err
'
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
cat-blob :403x
EOF
- cat err &&
test_i18ngrep "after mark" err
'
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
ls :302x hello.c
EOF
- cat err &&
test_i18ngrep "space after mark" err
'
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
ls ${sha1}x hello.c
EOF
- cat err &&
test_i18ngrep "space after tree-ish" err
'