summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <vicent@github.com>2014-04-08 16:37:39 +0200
committerVicent Marti <vicent@github.com>2014-04-08 16:37:39 +0200
commit2795fb4ddd69ca72828c2d4f1b94b77e4d91db48 (patch)
treecd787938b7a3355c005b7f6e91bf08fc83140b7a
parent5f74c476939894c4512262ec11188a44bfe4f50a (diff)
parent8a8e312792807dda38fbe417ec5d511f767f3ace (diff)
downloadlibgit2-2795fb4ddd69ca72828c2d4f1b94b77e4d91db48.tar.gz
Merge pull request #2256 from jacquesg/graph-descendant
Correct grouping of parentheses
-rw-r--r--src/graph.c2
-rw-r--r--tests/graph/descendant_of.c8
2 files changed, 9 insertions, 1 deletions
diff --git a/src/graph.c b/src/graph.c
index 96fda7add..1c6441140 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -180,7 +180,7 @@ int git_graph_descendant_of(git_repository *repo, const git_oid *commit, const g
if (git_oid_equal(commit, ancestor))
return 0;
- if ((error = git_merge_base(&merge_base, repo, commit, ancestor) < 0))
+ if ((error = git_merge_base(&merge_base, repo, commit, ancestor)) < 0)
return error;
return git_oid_equal(&merge_base, ancestor);
diff --git a/tests/graph/descendant_of.c b/tests/graph/descendant_of.c
index ffdd0cfc8..8e9952a09 100644
--- a/tests/graph/descendant_of.c
+++ b/tests/graph/descendant_of.c
@@ -45,3 +45,11 @@ void test_graph_descendant_of__returns_correct_result(void)
git_commit_free(other);
}
+
+void test_graph_descendant_of__nopath(void)
+{
+ git_oid oid;
+
+ git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d");
+ cl_assert_equal_i(0, git_graph_descendant_of(_repo, git_commit_id(commit), &oid));
+}