Commit de19c4a9582b74eec1d510d4ded5889d3b3e7976

Russell Belfer 2013-05-01T14:00:20

Set error when no merge base is found

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
diff --git a/src/merge.c b/src/merge.c
index e0010d6..48ff80c 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -86,6 +86,7 @@ int git_merge_base_many(git_oid *out, git_repository *repo, const git_oid input_
 		goto cleanup;
 
 	if (!result) {
+		giterr_set(GITERR_MERGE, "No merge base found");
 		error = GIT_ENOTFOUND;
 		goto cleanup;
 	}
@@ -131,7 +132,7 @@ int git_merge_base(git_oid *out, git_repository *repo, const git_oid *one, const
 
 	if (!result) {
 		git_revwalk_free(walk);
-		giterr_clear();
+		giterr_set(GITERR_MERGE, "No merge base found");
 		return GIT_ENOTFOUND;
 	}