summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/git/diff.py2
-rw-r--r--lib/git/refs.py3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/git/diff.py b/lib/git/diff.py
index 38430827..9b07b5ea 100644
--- a/lib/git/diff.py
+++ b/lib/git/diff.py
@@ -248,7 +248,7 @@ class Diff(object):
h = "%s"
if self.a_blob:
h %= self.a_blob.path
- if self.b_blob:
+ elif self.b_blob:
h %= self.b_blob.path
msg = ''
diff --git a/lib/git/refs.py b/lib/git/refs.py
index 208ce880..cf829cb6 100644
--- a/lib/git/refs.py
+++ b/lib/git/refs.py
@@ -236,6 +236,8 @@ class SymbolicReference(object):
@classmethod
def _to_full_path(cls, repo, path):
+ if isinstance(path, SymbolicReference):
+ path = path.path
full_ref_path = path
if not cls._common_path_default:
return full_ref_path
@@ -253,6 +255,7 @@ class SymbolicReference(object):
``path``
Short or full path pointing to the reference, i.e. refs/myreference
or just "myreference", hence 'refs/' is implied.
+ Alternatively the symbolic reference to be deleted
"""
full_ref_path = cls._to_full_path(repo, path)
abs_path = os.path.join(repo.path, full_ref_path)