diff options
author | James Moger <james.moger@gitblit.com> | 2011-07-22 10:09:18 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-07-22 10:09:18 -0400 |
commit | b1dba764c201f4708b82767b2d91edb6e189ce6f (patch) | |
tree | ad09c0c866cb7ece4888618594d51db034aaac82 /src/com/gitblit/utils | |
parent | 88598bb2f779b73479512d818c675dea8fa72138 (diff) | |
download | gitblit-b1dba764c201f4708b82767b2d91edb6e189ce6f.tar.gz gitblit-b1dba764c201f4708b82767b2d91edb6e189ce6f.zip |
Fixed (again) empty repository check (issue 13)
Diffstat (limited to 'src/com/gitblit/utils')
-rw-r--r-- | src/com/gitblit/utils/JGitUtils.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java index a72299dd..03a5d008 100644 --- a/src/com/gitblit/utils/JGitUtils.java +++ b/src/com/gitblit/utils/JGitUtils.java @@ -304,14 +304,14 @@ public class JGitUtils { /**
* Determine if a repository has any commits. This is determined by checking
- * the objects/info and objects/pack folders.
+ * the for loose and packed objects.
*
* @param repository
* @return true if the repository has commits
*/
public static boolean hasCommits(Repository repository) {
- if (repository != null && repository.getDirectory().exists()) {
- return (new File(repository.getDirectory(), "objects/info").list().length > 0)
+ if (repository != null && repository.getDirectory().exists()) {
+ return (new File(repository.getDirectory(), "objects").list().length > 2)
|| (new File(repository.getDirectory(), "objects/pack").list().length > 0);
}
return false;
|