diff options
author | Guido Günther <agx@sigxcpu.org> | 2013-06-11 15:20:44 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-06-11 15:27:02 +0200 |
commit | 4d6eecb73e34d9751a05c3908b4ad3f8960619ad (patch) | |
tree | 6c6b1582a3dc73d45452910aa1fcc8877fd02058 /gbp/git/repository.py | |
parent | a30f9e772cb8b4c48cca296bb3a7690c3e8ae418 (diff) |
GitRepository.get_subject: use get_commit_info
This kills another _git_getoutput. Also deprecate the method since we
don't need to special case the subject.
Diffstat (limited to 'gbp/git/repository.py')
-rw-r--r-- | gbp/git/repository.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/gbp/git/repository.py b/gbp/git/repository.py index e37e79d..61c825d 100644 --- a/gbp/git/repository.py +++ b/gbp/git/repository.py @@ -1342,7 +1342,7 @@ class GitRepository(object): if ret: raise GitRepositoryError("can't get %s: %s" % (id, stderr.rstrip())) return obj - + def grep_log(self, regex, since=None): """ Get commmits matching I{regex} @@ -1372,15 +1372,13 @@ class GitRepository(object): """ Gets the subject of a commit. + @deprecated: Use get_commit_info directly + @param commit: the commit to get the subject from @return: the commit's subject @rtype: C{str} """ - out, ret = self._git_getoutput('log', ['-n1', '--pretty=format:%s', commit]) - if ret: - raise GitRepositoryError("Error getting subject of commit %s" - % commit) - return out[0].strip() + return self.get_commit_info(commit)['subject'] def get_commit_info(self, commitish): """ |