Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-03-22 23:22:39 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-03-22 23:27:59 +0400
commit33a59401c377c329e8875cfad2a1332eb514b62a (patch)
tree53f81c0880145275391bbf31eeb3b913e456a334 /src/graph.c
parent7dbf4039ae0881407fc9ead24c09c1d7cfd4103a (diff)
graph: make the ahead-behind docs clearer
Explain it in local-upstream branch terms so it's easier to grasp than with the `one` and `two` naming from the merge-base code.
Diffstat (limited to 'src/graph.c')
-rw-r--r--src/graph.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/graph.c b/src/graph.c
index cb1727924..277f588ca 100644
--- a/src/graph.c
+++ b/src/graph.c
@@ -147,25 +147,25 @@ on_error:
}
int git_graph_ahead_behind(size_t *ahead, size_t *behind, git_repository *repo,
- const git_oid *one, const git_oid *two)
+ const git_oid *local, const git_oid *upstream)
{
git_revwalk *walk;
- git_commit_list_node *commit1, *commit2;
+ git_commit_list_node *commit_u, *commit_l;
if (git_revwalk_new(&walk, repo) < 0)
return -1;
- commit2 = git_revwalk__commit_lookup(walk, two);
- if (commit2 == NULL)
+ commit_u = git_revwalk__commit_lookup(walk, upstream);
+ if (commit_u == NULL)
goto on_error;
- commit1 = git_revwalk__commit_lookup(walk, one);
- if (commit1 == NULL)
+ commit_l = git_revwalk__commit_lookup(walk, local);
+ if (commit_l == NULL)
goto on_error;
- if (mark_parents(walk, commit1, commit2) < 0)
+ if (mark_parents(walk, commit_l, commit_u) < 0)
goto on_error;
- if (ahead_behind(commit1, commit2, ahead, behind) < 0)
+ if (ahead_behind(commit_l, commit_u, ahead, behind) < 0)
goto on_error;
git_revwalk_free(walk);