Skip to content

Commit f96366a

Browse files
authored
Merge pull request #8 from ndevenish/master
Don't just silently fail if git fails
2 parents 9223b09 + a5dfc30 commit f96366a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

git-blame.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ def get_blame(self, line, path):
6161
return shell(["git", "blame", "--minimal", "-w",
6262
"-L {0},{0}".format(line), path],
6363
cwd=os.path.dirname(os.path.realpath(path)),
64-
startupinfo=si)
64+
startupinfo=si,
65+
stderr=subprocess.STDOUT)
66+
except subprocess.CalledProcessError as e:
67+
print("Git blame: git error {}:\n{}".format(e.returncode, e.output.decode("UTF-8")))
6568
except Exception as e:
66-
return
69+
print("Git blame: Unexpected error:", e)
6770

6871
def parse_blame(self, blame):
6972
sha, file_path, user, date, time, tz_offset, *_ = blame.decode('utf-8').split()

0 commit comments

Comments
 (0)