summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Elijah Newren <newren@gmail.com>2019-10-03 13:27:04 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-04 07:33:21 +0900
commitf73b2aba05788208ccd9b48f350b90cbfe57e1c4 (patch)
treea82fc54fb135a3945bc1e3ad347ea14644bec822 /t
parentfast-import: fix handling of deleted tags (diff)
downloadtgif-f73b2aba05788208ccd9b48f350b90cbfe57e1c4.tar.xz
fast-import: allow tags to be identified by mark labels
Mark identifiers are used in fast-export and fast-import to provide a label to refer to earlier content. Blobs are given labels because they need to be referenced in the commits where they first appear with a given filename, and commits are given labels because they can be the parents of other commits. Tags were never given labels, probably because they were viewed as unnecessary, but that presents two problems: 1. It leaves us without a way of referring to previous tags if we want to create a tag of a tag (or higher nestings). 2. It leaves us with no way of recording that a tag has already been imported when using --export-marks and --import-marks. Fix these problems by allowing an optional mark label for tags. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t9300-fast-import.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t9300-fast-import.sh b/t/t9300-fast-import.sh
index 74bc41333b..3ad2b2f1ba 100755
--- a/t/t9300-fast-import.sh
+++ b/t/t9300-fast-import.sh
@@ -94,6 +94,23 @@ test_expect_success 'A: create pack from stdin' '
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
+
INPUT_END
git fast-import --export-marks=marks.out <input &&
git whatchanged master
@@ -176,6 +193,8 @@ test_expect_success 'A: verify marks output' '
: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)
EOF
test_cmp expect marks.out
'