allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/2] git commit: [#5879] Fixed error from all_commit_ids on empty git repo
Date Thu, 28 Mar 2013 21:36:11 GMT
Updated Branches:
  refs/heads/cj/5879 31e53c447 -> 99130f0cd


[#5879] Fixed error from all_commit_ids on empty git repo

Signed-off-by: Cory Johns <cjohns@slashdotmedia.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/143b7c93
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/143b7c93
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/143b7c93

Branch: refs/heads/cj/5879
Commit: 143b7c9338a95fc126bb2085c2a9babb719cfe6e
Parents: 31e53c4
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Mar 28 21:35:36 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Thu Mar 28 21:35:36 2013 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/143b7c93/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 1c59b52..39413b4 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -161,6 +161,8 @@ class GitImplementation(M.RepositoryImplementation):
         """Yield commit ids, starting with the head(s) of the commit tree and
         ending with the root (first commit).
         """
+        if not self._git.head.is_valid():
+            return  # empty repo
         seen = set()
         for ci in self._git.iter_commits(all=True, topo_order=True):
             if ci.binsha in seen: continue


Mime
View raw message