diff --git a/git-filter-repo b/git-filter-repo index ac039ec..3c7fd0c 100755 --- a/git-filter-repo +++ b/git-filter-repo @@ -1314,6 +1314,8 @@ class FastExportParser(object): if not tag.dumped: self._imported_refs.add(b'refs/tags/'+tag.ref) tag.dump(self._output) + else: + tag.skip() def _parse_progress(self): """ diff --git a/t/t9390-filter-repo.sh b/t/t9390-filter-repo.sh index 14bdeaa..d2186b0 100755 --- a/t/t9390-filter-repo.sh +++ b/t/t9390-filter-repo.sh @@ -317,6 +317,31 @@ test_expect_success '--tag-rename' ' ) ' +test_expect_success 'tag of tag before relevant portion of history' ' + test_create_repo filtered_tag_of_tag && + ( + cd filtered_tag_of_tag && + echo contents >file && + git add file && + git commit -m "Initial" && + + git tag -a -m "Inner Tag" inner_tag HEAD && + git tag -a -m "Outer Tag" outer_tag inner_tag && + + mkdir subdir && + echo stuff >subdir/whatever && + git add subdir && + git commit -m "Add file in subdir" && + + git filter-repo --force --subdirectory-filter subdir && + + git show-ref >refs && + ! grep refs/tags refs && + git log --all --oneline >commits && + test_line_count = 1 commits + ) +' + test_expect_success '--subdirectory-filter' ' setup_metasyntactic_repo && (