summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2016-09-16 17:36:02 +0300
committerRyan S. Arnold <ryan.arnold@linaro.org>2016-10-15 13:24:12 -0500
commit90277b8c11832f7f6696533acebe4db6afe273db (patch)
tree0966b8b7e7c920f60a00c0922b9f346e35c5f1c8
parent3e1cc0071c58cb7b2f12db0ea49c844cae14766d (diff)
Attempt to fix copy-pasted code
The GitRepo::log method has copy-pasted exception handling code from GitRepo::add. This commit fixes it to reference GitRepo::log parameters instead of GitRepo::add parameters, and also adds a TODO to add a unit test. The code is still untested and may be borked, but it's probably not worse than before.
-rw-r--r--linaropy/git/gitrepo.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/linaropy/git/gitrepo.py b/linaropy/git/gitrepo.py
index 667c8a9..a16501b 100644
--- a/linaropy/git/gitrepo.py
+++ b/linaropy/git/gitrepo.py
@@ -140,12 +140,13 @@ class GitRepo(object):
# Something was committed.
return True
+ # TODO: Write unit tests for this.
def log(self, number):
try:
with cd(self.repodir):
print git("log", "-n %d" % number)
except ErrorReturnCode:
- raise EnvironmentError("Unable to git add " + filetogitadd)
+ raise EnvironmentError("Unable to git log -n %d", number)
# TODO: Does this need to 'cd' first?
def edit(self, toedit):