diff options
author | Ben Straub <bs@github.com> | 2014-02-26 16:58:20 -0500 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2014-02-26 16:58:20 -0500 |
commit | 1574d3884f020c072f68c08785e199732e438e34 (patch) | |
tree | db2eed39930ac2353fe090b28d6260ee9e848a19 /src | |
parent | 6b34a4ed13e0a386abc0cd69dcba473958a21e74 (diff) | |
parent | 0276f0f55bf24dc5e0f49612106c1091381033f9 (diff) | |
download | libgit2-1574d3884f020c072f68c08785e199732e438e34.tar.gz |
Merge pull request #2137 from jru/blame-first-parent
Blame first-parent history
Diffstat (limited to 'src')
-rw-r--r-- | src/blame_git.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/blame_git.c b/src/blame_git.c index 800f1f039..72afb852b 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 && num_parents > 1) + /* 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; |