You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/04/03 19:29:27 UTC

[2/3] git commit: [#5879] Fixed error from all_commit_ids on empty git repo

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

Signed-off-by: Cory Johns <cj...@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/0531982a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/0531982a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/0531982a

Branch: refs/heads/master
Commit: 0531982a667b46d561f478e6f7685999f96aa5ab
Parents: db0d23f
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Mar 28 21:35:36 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Wed Apr 3 17:26:03 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/0531982a/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 299ddb2..e7d529f 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