summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-07-20 15:52:03 -0400
committerJames Moger <james.moger@gitblit.com>2011-07-20 15:52:03 -0400
commit330247866e931d5e5f93999db9947bc2fc1fc9ee (patch)
treed49ba05f7800e1b2eba6d5dbe3771ef95369b338 /src
parent072bbe1b223c6f6c7a80ee86e00a41e15913b4ee (diff)
downloadgitblit-330247866e931d5e5f93999db9947bc2fc1fc9ee.tar.gz
gitblit-330247866e931d5e5f93999db9947bc2fc1fc9ee.zip
Redefined how to check for "empty" repository (issue 13)
Diffstat (limited to 'src')
-rw-r--r--src/com/gitblit/utils/JGitUtils.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index a965aff3..f8de4299 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -306,7 +306,8 @@ public class JGitUtils {
*/
public static boolean hasCommits(Repository repository) {
if (repository != null && repository.getDirectory().exists()) {
- return new File(repository.getDirectory(), Constants.R_HEADS).list().length > 0;
+ return (new File(repository.getDirectory(), "objects/info").list().length > 0)
+ || (new File(repository.getDirectory(), "objects/pack").list().length > 0);
}
return false;
}