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:
authorBen Straub <bs@github.com>2014-02-27 01:58:20 +0400
committerBen Straub <bs@github.com>2014-02-27 01:58:20 +0400
commit1574d3884f020c072f68c08785e199732e438e34 (patch)
treedb2eed39930ac2353fe090b28d6260ee9e848a19 /tests/blame
parent6b34a4ed13e0a386abc0cd69dcba473958a21e74 (diff)
parent0276f0f55bf24dc5e0f49612106c1091381033f9 (diff)
Merge pull request #2137 from jru/blame-first-parent
Blame first-parent history
Diffstat (limited to 'tests/blame')
-rw-r--r--tests/blame/simple.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/blame/simple.c b/tests/blame/simple.c
index 79bd56b83..11ff4cd19 100644
--- a/tests/blame/simple.c
+++ b/tests/blame/simple.c
@@ -303,3 +303,18 @@ void test_blame_simple__can_restrict_to_newish_commits(void)
check_blame_hunk_index(g_repo, g_blame, 0, 1, 1, 1, "be3563a", "branch_file.txt");
check_blame_hunk_index(g_repo, g_blame, 1, 2, 1, 0, "a65fedf", "branch_file.txt");
}
+
+void test_blame_simple__can_restrict_to_first_parent_commits(void)
+{
+ git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
+ opts.flags |= GIT_BLAME_FIRST_PARENT;
+
+ cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
+
+ cl_git_pass(git_blame_file(&g_blame, g_repo, "b.txt", &opts));
+ cl_assert_equal_i(4, git_blame_get_hunk_count(g_blame));
+ check_blame_hunk_index(g_repo, g_blame, 0, 1, 4, 0, "da237394", "b.txt");
+ check_blame_hunk_index(g_repo, g_blame, 1, 5, 1, 1, "b99f7ac0", "b.txt");
+ check_blame_hunk_index(g_repo, g_blame, 2, 6, 5, 0, "63d671eb", "b.txt");
+ check_blame_hunk_index(g_repo, g_blame, 3, 11, 5, 0, "bc7c5ac2", "b.txt");
+}