summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJuan Rubén <juanruben.segovia@gmail.com>2014-02-21 00:22:07 +0100
committerJuan Rubén <juanruben.segovia@gmail.com>2014-02-23 23:26:12 +0100
commitc7c833947ec7ac446761242c02d32916661daeb7 (patch)
tree226a4eb8de0a1366ac04ab921411847693c11581 /src
parente0ebaaa53ea1154a1f392dae463453ac6c428d78 (diff)
downloadlibgit2-c7c833947ec7ac446761242c02d32916661daeb7.tar.gz
Add option to limit blame to first parent
Diffstat (limited to 'src')
-rw-r--r--src/blame_git.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/blame_git.c b/src/blame_git.c
index 800f1f039..c275293c3 100644
--- a/src/blame_git.c
+++ b/src/blame_git.c
@@ -485,12 +485,14 @@ static void pass_blame(git_blame *blame, git_blame__origin *origin, uint32_t opt
git_blame__origin *sg_buf[16];
git_blame__origin *porigin, **sg_origin = sg_buf;
- GIT_UNUSED(opt);
-
num_parents = git_commit_parentcount(commit);
if (!git_oid_cmp(git_commit_id(commit), &blame->options.oldest_commit))
/* Stop at oldest specified commit */
num_parents = 0;
+ else if (opt & GIT_BLAME_FIRST_PARENT)
+ /* Limit search to the first parent */
+ num_parents = 1;
+
if (!num_parents) {
git_oid_cpy(&blame->options.oldest_commit, git_commit_id(commit));
goto finish;