Commit 8a4a343a2b230acc69ba13131355f8299b4483d3

Patrick Steinhardt 2016-03-10T16:33:49

blame_git: handle error returned by `git_commit_parent`

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/blame_git.c b/src/blame_git.c
index b8b5682..700207e 100644
--- a/src/blame_git.c
+++ b/src/blame_git.c
@@ -525,7 +525,8 @@ static int pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt)
 		if (sg_origin[i])
 			continue;
 
-		git_commit_parent(&p, origin->commit, i);
+		if ((error = git_commit_parent(&p, origin->commit, i)) < 0)
+			goto finish;
 		porigin = find_origin(blame, p, origin);
 
 		if (!porigin)