From 4e46a8d62c551e11e21bd04e059e9ae3cdcfd029 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 20 Dec 2008 01:00:27 +0100 Subject: fast-export: deal with tag objects that do not have a tagger When no tagger was found (old Git produced tags like this), no "tagger" line is printed (but this is incompatible with the current git fast-import). Alternatively, you can pass the option --fake-missing-tagger, forcing fast-export to fake a tagger Unspecified Tagger with a tag date of the beginning of (Unix) time in the case of a missing tagger, so that fast-import is still able to import the result. Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t9301-fast-export.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 't/t9301-fast-export.sh') diff --git a/t/t9301-fast-export.sh b/t/t9301-fast-export.sh index 638c858dc7..3a6509a1c8 100755 --- a/t/t9301-fast-export.sh +++ b/t/t9301-fast-export.sh @@ -239,4 +239,24 @@ test_expect_success 'fast-export | fast-import when master is tagged' ' ' +cat > tag-content << EOF +object $(git rev-parse HEAD) +type commit +tag rosten +EOF + +test_expect_success 'cope with tagger-less tags' ' + + TAG=$(git hash-object -t tag -w tag-content) && + git update-ref refs/tags/sonnenschein $TAG && + git fast-export -C -C --signed-tags=strip --all > output && + test $(grep -c "^tag " output) = 4 && + ! grep "Unspecified Tagger" output && + git fast-export -C -C --signed-tags=strip --all \ + --fake-missing-tagger > output && + test $(grep -c "^tag " output) = 4 && + grep "Unspecified Tagger" output + +' + test_done -- cgit v1.2.3