Skip to content

Commit 71c76c6

Browse files
Vladimir Kotalahornace
authored andcommitted
skip over false tags
fixes #3502
1 parent db10ee1 commit 71c76c6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/GitRepository.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,13 @@ private void rebuildTagList(File directory) {
632632
Map<RevCommit, String> commit2Tags = new HashMap<>();
633633
for (Ref ref : refList) {
634634
String tagName = ref.getName().replace("refs/tags/", "");
635-
RevCommit commit = getCommit(repository, ref);
636-
commit2Tags.merge(commit, tagName, (oldValue, newValue) -> oldValue + TAGS_SEPARATOR + newValue);
635+
try {
636+
RevCommit commit = getCommit(repository, ref);
637+
commit2Tags.merge(commit, tagName, (oldValue, newValue) -> oldValue + TAGS_SEPARATOR + newValue);
638+
} catch (IOException e) {
639+
LOGGER.log(Level.FINEST,
640+
String.format("cannot get tags for \"" + directory.getAbsolutePath() + "\""), e);
641+
}
637642
}
638643

639644
for (Map.Entry<RevCommit, String> entry : commit2Tags.entrySet()) {
@@ -649,7 +654,7 @@ private void rebuildTagList(File directory) {
649654
// In case of partial success, do not null-out tagList here.
650655
}
651656

652-
if (LOGGER.isLoggable(Level.FINEST)) {
657+
if (LOGGER.isLoggable(Level.FINER)) {
653658
LOGGER.log(Level.FINEST, "Read tags count={0} for {1}",
654659
new Object[] {tagList.size(), directory});
655660
}

0 commit comments

Comments
 (0)