diff options
Diffstat (limited to 'lib/git_python/repo.py')
-rw-r--r-- | lib/git_python/repo.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/git_python/repo.py b/lib/git_python/repo.py index 20f60a3d..f04ba19c 100644 --- a/lib/git_python/repo.py +++ b/lib/git_python/repo.py @@ -159,7 +159,11 @@ class Repo(object): """ options = {'max_count': 1} - return Commit.find_all(self, id, **options)[0] + commits = Commit.find_all(self, id, **options) + + if not commits: + raise ValueError, 'Invalid identifier %s' % id + return commits[0] def commit_deltas_from(self, other_repo, ref = 'master', other_ref = 'master'): """ @@ -369,7 +373,7 @@ class Repo(object): else: return os.remove(os.path.join(self.path, '.git', DAEMON_EXPORT_FILE)) - def get_alternates(self): + def _get_alternates(self): """ The list of alternates for this repo @@ -388,7 +392,7 @@ class Repo(object): else: return [] - def set_alternates(self, alts): + def _set_alternates(self, alts): """ Sets the alternates @@ -411,7 +415,7 @@ class Repo(object): finally: f.close() - alternates = property(get_alternates, set_alternates) + alternates = property(_get_alternates, _set_alternates) def __repr__(self): return '<GitPython.Repo "%s">' % self.path |