allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [07/50] [abbrv] git commit: [#5879] Fixed error from all_commit_ids on empty git repo
Date Thu, 04 Apr 2013 18:37:09 GMT
[#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/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/db/5453
Commit: 0531982a667b46d561f478e6f7685999f96aa5ab
Parents: db0d23f
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Mar 28 21:35:36 2013 +0000
Committer: Cory Johns <cjohns@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


Mime
View raw message