Skip to content

Commit f98c36a

Browse files
idodeclareVladimir Kotal
authored andcommitted
Fix #2698 : recognize .git file for a worktree
1 parent a1b78ff commit f98c36a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
/*
2121
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
22-
* Portions Copyright (c) 2017-2018, Chris Fraire <[email protected]>.
22+
* Portions Copyright (c) 2017-2019, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opengrok.indexer.history;
2525

@@ -104,6 +104,7 @@ public GitRepository() {
104104
};
105105

106106
ignoredDirs.add(".git");
107+
ignoredFiles.add(".git");
107108
ignoredFiles.add(".gitignore");
108109
}
109110

@@ -515,7 +516,7 @@ public boolean fileHasHistory(File file) {
515516
boolean isRepositoryFor(File file, boolean interactive) {
516517
if (file.isDirectory()) {
517518
File f = new File(file, ".git");
518-
return f.exists() && f.isDirectory();
519+
return f.exists();
519520
}
520521
return false;
521522
}

0 commit comments

Comments
 (0)