]> git.proxmox.com Git - libgit2.git/blob - tests/blame/simple.c
30b78168f90ec6990ca1523cdef344ccf2cfbef3
[libgit2.git] / tests / blame / simple.c
1 #include "blame_helpers.h"
2
3 static git_repository *g_repo;
4 static git_blame *g_blame;
5
6 void test_blame_simple__initialize(void)
7 {
8 g_repo = NULL;
9 g_blame = NULL;
10 }
11
12 void test_blame_simple__cleanup(void)
13 {
14 git_blame_free(g_blame);
15 git_repository_free(g_repo);
16 }
17
18 /*
19 * $ git blame -s branch_file.txt
20 * orig line no final line no
21 * commit V author timestamp V
22 * c47800c7 1 (Scott Chacon 2010-05-25 11:58:14 -0700 1
23 * a65fedf3 2 (Scott Chacon 2011-08-09 19:33:46 -0700 2
24 */
25 void test_blame_simple__trivial_testrepo(void)
26 {
27 cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo/.gitted")));
28 cl_git_pass(git_blame_file(&g_blame, g_repo, "branch_file.txt", NULL));
29
30 cl_assert_equal_i(2, git_blame_get_hunk_count(g_blame));
31 check_blame_hunk_index(g_repo, g_blame, 0, 1, 1, 0, "c47800c7", "branch_file.txt");
32 check_blame_hunk_index(g_repo, g_blame, 1, 2, 1, 0, "a65fedf3", "branch_file.txt");
33 }
34
35 /*
36 * $ git blame -n b.txt
37 * orig line no final line no
38 * commit V author timestamp V
39 * da237394 1 (Ben Straub 2013-02-12 15:11:30 -0800 1
40 * da237394 2 (Ben Straub 2013-02-12 15:11:30 -0800 2
41 * da237394 3 (Ben Straub 2013-02-12 15:11:30 -0800 3
42 * da237394 4 (Ben Straub 2013-02-12 15:11:30 -0800 4
43 * ^b99f7ac 1 (Ben Straub 2013-02-12 15:10:12 -0800 5
44 * 63d671eb 6 (Ben Straub 2013-02-12 15:13:04 -0800 6
45 * 63d671eb 7 (Ben Straub 2013-02-12 15:13:04 -0800 7
46 * 63d671eb 8 (Ben Straub 2013-02-12 15:13:04 -0800 8
47 * 63d671eb 9 (Ben Straub 2013-02-12 15:13:04 -0800 9
48 * 63d671eb 10 (Ben Straub 2013-02-12 15:13:04 -0800 10
49 * aa06ecca 6 (Ben Straub 2013-02-12 15:14:46 -0800 11
50 * aa06ecca 7 (Ben Straub 2013-02-12 15:14:46 -0800 12
51 * aa06ecca 8 (Ben Straub 2013-02-12 15:14:46 -0800 13
52 * aa06ecca 9 (Ben Straub 2013-02-12 15:14:46 -0800 14
53 * aa06ecca 10 (Ben Straub 2013-02-12 15:14:46 -0800 15
54 */
55 void test_blame_simple__trivial_blamerepo(void)
56 {
57 cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
58 cl_git_pass(git_blame_file(&g_blame, g_repo, "b.txt", NULL));
59
60 cl_assert_equal_i(4, git_blame_get_hunk_count(g_blame));
61 check_blame_hunk_index(g_repo, g_blame, 0, 1, 4, 0, "da237394", "b.txt");
62 check_blame_hunk_index(g_repo, g_blame, 1, 5, 1, 1, "b99f7ac0", "b.txt");
63 check_blame_hunk_index(g_repo, g_blame, 2, 6, 5, 0, "63d671eb", "b.txt");
64 check_blame_hunk_index(g_repo, g_blame, 3, 11, 5, 0, "aa06ecca", "b.txt");
65 }
66
67
68 /*
69 * $ git blame -n 359fc2d -- include/git2.h
70 * orig line no final line no
71 * commit orig path V author timestamp V
72 * d12299fe src/git.h 1 (Vicent Martí 2010-12-03 22:22:10 +0200 1
73 * 359fc2d2 include/git2.h 2 (Edward Thomson 2013-01-08 17:07:25 -0600 2
74 * d12299fe src/git.h 5 (Vicent Martí 2010-12-03 22:22:10 +0200 3
75 * bb742ede include/git2.h 4 (Vicent Martí 2011-09-19 01:54:32 +0300 4
76 * bb742ede include/git2.h 5 (Vicent Martí 2011-09-19 01:54:32 +0300 5
77 * d12299fe src/git.h 24 (Vicent Martí 2010-12-03 22:22:10 +0200 6
78 * d12299fe src/git.h 25 (Vicent Martí 2010-12-03 22:22:10 +0200 7
79 * d12299fe src/git.h 26 (Vicent Martí 2010-12-03 22:22:10 +0200 8
80 * d12299fe src/git.h 27 (Vicent Martí 2010-12-03 22:22:10 +0200 9
81 * d12299fe src/git.h 28 (Vicent Martí 2010-12-03 22:22:10 +0200 10
82 * 96fab093 include/git2.h 11 (Sven Strickroth 2011-10-09 18:37:41 +0200 11
83 * 9d1dcca2 src/git2.h 33 (Vicent Martí 2011-02-07 10:35:58 +0200 12
84 * 44908fe7 src/git2.h 29 (Vicent Martí 2010-12-06 23:03:16 +0200 13
85 * a15c550d include/git2.h 14 (Vicent Martí 2011-11-16 14:09:44 +0100 14
86 * 44908fe7 src/git2.h 30 (Vicent Martí 2010-12-06 23:03:16 +0200 15
87 * d12299fe src/git.h 32 (Vicent Martí 2010-12-03 22:22:10 +0200 16
88 * 44908fe7 src/git2.h 33 (Vicent Martí 2010-12-06 23:03:16 +0200 17
89 * d12299fe src/git.h 34 (Vicent Martí 2010-12-03 22:22:10 +0200 18
90 * 44908fe7 src/git2.h 35 (Vicent Martí 2010-12-06 23:03:16 +0200 19
91 * 638c2ca4 src/git2.h 36 (Vicent Martí 2010-12-18 02:10:25 +0200 20
92 * 44908fe7 src/git2.h 36 (Vicent Martí 2010-12-06 23:03:16 +0200 21
93 * d12299fe src/git.h 37 (Vicent Martí 2010-12-03 22:22:10 +0200 22
94 * 44908fe7 src/git2.h 38 (Vicent Martí 2010-12-06 23:03:16 +0200 23
95 * 44908fe7 src/git2.h 39 (Vicent Martí 2010-12-06 23:03:16 +0200 24
96 * bf787bd8 include/git2.h 25 (Carlos Martín Nieto 2012-04-08 18:56:50 +0200 25
97 * 0984c876 include/git2.h 26 (Scott J. Goldman 2012-11-28 18:27:43 -0800 26
98 * 2f8a8ab2 src/git2.h 41 (Vicent Martí 2011-01-29 01:56:25 +0200 27
99 * 27df4275 include/git2.h 47 (Michael Schubert 2011-06-28 14:13:12 +0200 28
100 * a346992f include/git2.h 28 (Ben Straub 2012-05-10 09:47:14 -0700 29
101 * d12299fe src/git.h 40 (Vicent Martí 2010-12-03 22:22:10 +0200 30
102 * 44908fe7 src/git2.h 41 (Vicent Martí 2010-12-06 23:03:16 +0200 31
103 * 44908fe7 src/git2.h 42 (Vicent Martí 2010-12-06 23:03:16 +0200 32
104 * 44908fe7 src/git2.h 43 (Vicent Martí 2010-12-06 23:03:16 +0200 33
105 * 44908fe7 src/git2.h 44 (Vicent Martí 2010-12-06 23:03:16 +0200 34
106 * 44908fe7 src/git2.h 45 (Vicent Martí 2010-12-06 23:03:16 +0200 35
107 * 65b09b1d include/git2.h 33 (Russell Belfer 2012-02-02 18:03:43 -0800 36
108 * d12299fe src/git.h 46 (Vicent Martí 2010-12-03 22:22:10 +0200 37
109 * 44908fe7 src/git2.h 47 (Vicent Martí 2010-12-06 23:03:16 +0200 38
110 * 5d4cd003 include/git2.h 55 (Carlos Martín Nieto 2011-03-28 17:02:45 +0200 39
111 * 41fb1ca0 include/git2.h 39 (Philip Kelley 2012-10-29 13:41:14 -0400 40
112 * 2dc31040 include/git2.h 56 (Carlos Martín Nieto 2011-06-20 18:58:57 +0200 41
113 * 764df57e include/git2.h 40 (Ben Straub 2012-06-15 13:14:43 -0700 42
114 * 5280f4e6 include/git2.h 41 (Ben Straub 2012-07-31 19:39:06 -0700 43
115 * 613d5eb9 include/git2.h 43 (Philip Kelley 2012-11-28 11:42:37 -0500 44
116 * d12299fe src/git.h 48 (Vicent Martí 2010-12-03 22:22:10 +0200 45
117 * 111ee3fe include/git2.h 41 (Vicent Martí 2012-07-11 14:37:26 +0200 46
118 * f004c4a8 include/git2.h 44 (Russell Belfer 2012-08-21 17:26:39 -0700 47
119 * 111ee3fe include/git2.h 42 (Vicent Martí 2012-07-11 14:37:26 +0200 48
120 * 9c82357b include/git2.h 58 (Carlos Martín Nieto 2011-06-17 18:13:14 +0200 49
121 * d6258deb include/git2.h 61 (Carlos Martín Nieto 2011-06-25 15:10:09 +0200 50
122 * b311e313 include/git2.h 63 (Julien Miotte 2011-07-27 18:31:13 +0200 51
123 * 3412391d include/git2.h 63 (Carlos Martín Nieto 2011-07-07 11:47:31 +0200 52
124 * bfc9ca59 include/git2.h 43 (Russell Belfer 2012-03-28 16:45:36 -0700 53
125 * bf477ed4 include/git2.h 44 (Michael Schubert 2012-02-15 00:33:38 +0100 54
126 * edebceff include/git2.h 46 (nulltoken 2012-05-01 13:57:45 +0200 55
127 * 743a4b3b include/git2.h 48 (nulltoken 2012-06-15 22:24:59 +0200 56
128 * 0a32dca5 include/git2.h 54 (Michael Schubert 2012-08-19 22:26:32 +0200 57
129 * 590fb68b include/git2.h 55 (nulltoken 2012-10-04 13:47:45 +0200 58
130 * bf477ed4 include/git2.h 45 (Michael Schubert 2012-02-15 00:33:38 +0100 59
131 * d12299fe src/git.h 49 (Vicent Martí 2010-12-03 22:22:10 +0200 60
132 */
133 void test_blame_simple__trivial_libgit2(void)
134 {
135 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
136 git_object *obj;
137
138 /* If we can't open the libgit2 repo or if it isn't a full repo
139 * with proper history, just skip this test */
140 if (git_repository_open(&g_repo, cl_fixture("../..")) < 0)
141 cl_skip();
142
143 if (git_repository_is_shallow(g_repo))
144 cl_skip();
145
146 if (git_revparse_single(&obj, g_repo, "359fc2d") < 0)
147 cl_skip();
148
149 git_oid_cpy(&opts.newest_commit, git_object_id(obj));
150 git_object_free(obj);
151
152 cl_git_pass(git_blame_file(&g_blame, g_repo, "include/git2.h", &opts));
153
154 check_blame_hunk_index(g_repo, g_blame, 0, 1, 1, 0, "d12299fe", "src/git.h");
155 check_blame_hunk_index(g_repo, g_blame, 1, 2, 1, 0, "359fc2d2", "include/git2.h");
156 check_blame_hunk_index(g_repo, g_blame, 2, 3, 1, 0, "d12299fe", "src/git.h");
157 check_blame_hunk_index(g_repo, g_blame, 3, 4, 2, 0, "bb742ede", "include/git2.h");
158 check_blame_hunk_index(g_repo, g_blame, 4, 6, 5, 0, "d12299fe", "src/git.h");
159 check_blame_hunk_index(g_repo, g_blame, 5, 11, 1, 0, "96fab093", "include/git2.h");
160 check_blame_hunk_index(g_repo, g_blame, 6, 12, 1, 0, "9d1dcca2", "src/git2.h");
161 check_blame_hunk_index(g_repo, g_blame, 7, 13, 1, 0, "44908fe7", "src/git2.h");
162 check_blame_hunk_index(g_repo, g_blame, 8, 14, 1, 0, "a15c550d", "include/git2.h");
163 check_blame_hunk_index(g_repo, g_blame, 9, 15, 1, 0, "44908fe7", "src/git2.h");
164 check_blame_hunk_index(g_repo, g_blame, 10, 16, 1, 0, "d12299fe", "src/git.h");
165 check_blame_hunk_index(g_repo, g_blame, 11, 17, 1, 0, "44908fe7", "src/git2.h");
166 check_blame_hunk_index(g_repo, g_blame, 12, 18, 1, 0, "d12299fe", "src/git.h");
167 check_blame_hunk_index(g_repo, g_blame, 13, 19, 1, 0, "44908fe7", "src/git2.h");
168 check_blame_hunk_index(g_repo, g_blame, 14, 20, 1, 0, "638c2ca4", "src/git2.h");
169 check_blame_hunk_index(g_repo, g_blame, 15, 21, 1, 0, "44908fe7", "src/git2.h");
170 check_blame_hunk_index(g_repo, g_blame, 16, 22, 1, 0, "d12299fe", "src/git.h");
171 check_blame_hunk_index(g_repo, g_blame, 17, 23, 2, 0, "44908fe7", "src/git2.h");
172 check_blame_hunk_index(g_repo, g_blame, 18, 25, 1, 0, "bf787bd8", "include/git2.h");
173 check_blame_hunk_index(g_repo, g_blame, 19, 26, 1, 0, "0984c876", "include/git2.h");
174 check_blame_hunk_index(g_repo, g_blame, 20, 27, 1, 0, "2f8a8ab2", "src/git2.h");
175 check_blame_hunk_index(g_repo, g_blame, 21, 28, 1, 0, "27df4275", "include/git2.h");
176 check_blame_hunk_index(g_repo, g_blame, 22, 29, 1, 0, "a346992f", "include/git2.h");
177 check_blame_hunk_index(g_repo, g_blame, 23, 30, 1, 0, "d12299fe", "src/git.h");
178 check_blame_hunk_index(g_repo, g_blame, 24, 31, 5, 0, "44908fe7", "src/git2.h");
179 check_blame_hunk_index(g_repo, g_blame, 25, 36, 1, 0, "65b09b1d", "include/git2.h");
180 check_blame_hunk_index(g_repo, g_blame, 26, 37, 1, 0, "d12299fe", "src/git.h");
181 check_blame_hunk_index(g_repo, g_blame, 27, 38, 1, 0, "44908fe7", "src/git2.h");
182 check_blame_hunk_index(g_repo, g_blame, 28, 39, 1, 0, "5d4cd003", "include/git2.h");
183 check_blame_hunk_index(g_repo, g_blame, 29, 40, 1, 0, "41fb1ca0", "include/git2.h");
184 check_blame_hunk_index(g_repo, g_blame, 30, 41, 1, 0, "2dc31040", "include/git2.h");
185 check_blame_hunk_index(g_repo, g_blame, 31, 42, 1, 0, "764df57e", "include/git2.h");
186 check_blame_hunk_index(g_repo, g_blame, 32, 43, 1, 0, "5280f4e6", "include/git2.h");
187 check_blame_hunk_index(g_repo, g_blame, 33, 44, 1, 0, "613d5eb9", "include/git2.h");
188 check_blame_hunk_index(g_repo, g_blame, 34, 45, 1, 0, "d12299fe", "src/git.h");
189 check_blame_hunk_index(g_repo, g_blame, 35, 46, 1, 0, "111ee3fe", "include/git2.h");
190 check_blame_hunk_index(g_repo, g_blame, 36, 47, 1, 0, "f004c4a8", "include/git2.h");
191 check_blame_hunk_index(g_repo, g_blame, 37, 48, 1, 0, "111ee3fe", "include/git2.h");
192 check_blame_hunk_index(g_repo, g_blame, 38, 49, 1, 0, "9c82357b", "include/git2.h");
193 check_blame_hunk_index(g_repo, g_blame, 39, 50, 1, 0, "d6258deb", "include/git2.h");
194 check_blame_hunk_index(g_repo, g_blame, 40, 51, 1, 0, "b311e313", "include/git2.h");
195 check_blame_hunk_index(g_repo, g_blame, 41, 52, 1, 0, "3412391d", "include/git2.h");
196 check_blame_hunk_index(g_repo, g_blame, 42, 53, 1, 0, "bfc9ca59", "include/git2.h");
197 check_blame_hunk_index(g_repo, g_blame, 43, 54, 1, 0, "bf477ed4", "include/git2.h");
198 check_blame_hunk_index(g_repo, g_blame, 44, 55, 1, 0, "edebceff", "include/git2.h");
199 check_blame_hunk_index(g_repo, g_blame, 45, 56, 1, 0, "743a4b3b", "include/git2.h");
200 check_blame_hunk_index(g_repo, g_blame, 46, 57, 1, 0, "0a32dca5", "include/git2.h");
201 check_blame_hunk_index(g_repo, g_blame, 47, 58, 1, 0, "590fb68b", "include/git2.h");
202 check_blame_hunk_index(g_repo, g_blame, 48, 59, 1, 0, "bf477ed4", "include/git2.h");
203 check_blame_hunk_index(g_repo, g_blame, 49, 60, 1, 0, "d12299fe", "src/git.h");
204 }
205
206
207 /*
208 * $ git blame -n b.txt -L 8
209 * orig line no final line no
210 * commit V author timestamp V
211 * 63d671eb 8 (Ben Straub 2013-02-12 15:13:04 -0800 8
212 * 63d671eb 9 (Ben Straub 2013-02-12 15:13:04 -0800 9
213 * 63d671eb 10 (Ben Straub 2013-02-12 15:13:04 -0800 10
214 * aa06ecca 6 (Ben Straub 2013-02-12 15:14:46 -0800 11
215 * aa06ecca 7 (Ben Straub 2013-02-12 15:14:46 -0800 12
216 * aa06ecca 8 (Ben Straub 2013-02-12 15:14:46 -0800 13
217 * aa06ecca 9 (Ben Straub 2013-02-12 15:14:46 -0800 14
218 * aa06ecca 10 (Ben Straub 2013-02-12 15:14:46 -0800 15
219 */
220 void test_blame_simple__can_restrict_lines_min(void)
221 {
222 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
223
224 cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
225
226 opts.min_line = 8;
227 cl_git_pass(git_blame_file(&g_blame, g_repo, "b.txt", &opts));
228 cl_assert_equal_i(2, git_blame_get_hunk_count(g_blame));
229 check_blame_hunk_index(g_repo, g_blame, 0, 8, 3, 0, "63d671eb", "b.txt");
230 check_blame_hunk_index(g_repo, g_blame, 1, 11, 5, 0, "aa06ecca", "b.txt");
231 }
232
233 /*
234 * $ git blame -n b.txt -L ,6
235 * orig line no final line no
236 * commit V author timestamp V
237 * da237394 1 (Ben Straub 2013-02-12 15:11:30 -0800 1
238 * da237394 2 (Ben Straub 2013-02-12 15:11:30 -0800 2
239 * da237394 3 (Ben Straub 2013-02-12 15:11:30 -0800 3
240 * da237394 4 (Ben Straub 2013-02-12 15:11:30 -0800 4
241 * ^b99f7ac 1 (Ben Straub 2013-02-12 15:10:12 -0800 5
242 * 63d671eb 6 (Ben Straub 2013-02-12 15:13:04 -0800 6
243 */
244 void test_blame_simple__can_restrict_lines_max(void)
245 {
246 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
247
248 cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
249
250 opts.max_line = 6;
251 cl_git_pass(git_blame_file(&g_blame, g_repo, "b.txt", &opts));
252 cl_assert_equal_i(3, git_blame_get_hunk_count(g_blame));
253 check_blame_hunk_index(g_repo, g_blame, 0, 1, 4, 0, "da237394", "b.txt");
254 check_blame_hunk_index(g_repo, g_blame, 1, 5, 1, 1, "b99f7ac0", "b.txt");
255 check_blame_hunk_index(g_repo, g_blame, 2, 6, 1, 0, "63d671eb", "b.txt");
256 }
257
258 /*
259 * $ git blame -n b.txt -L 2,7
260 * orig line no final line no
261 * commit V author timestamp V
262 * da237394 2 (Ben Straub 2013-02-12 15:11:30 -0800 2
263 * da237394 3 (Ben Straub 2013-02-12 15:11:30 -0800 3
264 * da237394 4 (Ben Straub 2013-02-12 15:11:30 -0800 4
265 * ^b99f7ac 1 (Ben Straub 2013-02-12 15:10:12 -0800 5
266 * 63d671eb 6 (Ben Straub 2013-02-12 15:13:04 -0800 6
267 * 63d671eb 7 (Ben Straub 2013-02-12 15:13:04 -0800 7
268 */
269 void test_blame_simple__can_restrict_lines_both(void)
270 {
271 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
272
273 cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
274
275 opts.min_line = 2;
276 opts.max_line = 7;
277 cl_git_pass(git_blame_file(&g_blame, g_repo, "b.txt", &opts));
278 cl_assert_equal_i(3, git_blame_get_hunk_count(g_blame));
279 check_blame_hunk_index(g_repo, g_blame, 0, 2, 3, 0, "da237394", "b.txt");
280 check_blame_hunk_index(g_repo, g_blame, 1, 5, 1, 1, "b99f7ac0", "b.txt");
281 check_blame_hunk_index(g_repo, g_blame, 2, 6, 2, 0, "63d671eb", "b.txt");
282 }
283
284 void test_blame_simple__can_blame_huge_file(void)
285 {
286 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
287
288 cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
289
290 cl_git_pass(git_blame_file(&g_blame, g_repo, "huge.txt", &opts));
291 cl_assert_equal_i(2, git_blame_get_hunk_count(g_blame));
292 check_blame_hunk_index(g_repo, g_blame, 0, 1, 65536, 0, "4eecfea", "huge.txt");
293 check_blame_hunk_index(g_repo, g_blame, 1, 65537, 1, 0, "6653ff4", "huge.txt");
294 }
295
296 /*
297 * $ git blame -n branch_file.txt be3563a..HEAD
298 * orig line no final line no
299 * commit V author timestamp V
300 * ^be3563a 1 (Scott Chacon 2010-05-25 11:58:27 -0700 1) hi
301 * a65fedf3 2 (Scott Chacon 2011-08-09 19:33:46 -0700 2) bye!
302 */
303 void test_blame_simple__can_restrict_to_newish_commits(void)
304 {
305 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
306
307 cl_git_pass(git_repository_open(&g_repo, cl_fixture("testrepo.git")));
308
309 {
310 git_object *obj;
311 cl_git_pass(git_revparse_single(&obj, g_repo, "be3563a"));
312 git_oid_cpy(&opts.oldest_commit, git_object_id(obj));
313 git_object_free(obj);
314 }
315
316 cl_git_pass(git_blame_file(&g_blame, g_repo, "branch_file.txt", &opts));
317
318 cl_assert_equal_i(2, git_blame_get_hunk_count(g_blame));
319 check_blame_hunk_index(g_repo, g_blame, 0, 1, 1, 1, "be3563a", "branch_file.txt");
320 check_blame_hunk_index(g_repo, g_blame, 1, 2, 1, 0, "a65fedf", "branch_file.txt");
321 }
322
323 void test_blame_simple__can_restrict_to_first_parent_commits(void)
324 {
325 git_blame_options opts = GIT_BLAME_OPTIONS_INIT;
326 opts.flags |= GIT_BLAME_FIRST_PARENT;
327
328 cl_git_pass(git_repository_open(&g_repo, cl_fixture("blametest.git")));
329
330 cl_git_pass(git_blame_file(&g_blame, g_repo, "b.txt", &opts));
331 cl_assert_equal_i(4, git_blame_get_hunk_count(g_blame));
332 check_blame_hunk_index(g_repo, g_blame, 0, 1, 4, 0, "da237394", "b.txt");
333 check_blame_hunk_index(g_repo, g_blame, 1, 5, 1, 1, "b99f7ac0", "b.txt");
334 check_blame_hunk_index(g_repo, g_blame, 2, 6, 5, 0, "63d671eb", "b.txt");
335 check_blame_hunk_index(g_repo, g_blame, 3, 11, 5, 0, "bc7c5ac2", "b.txt");
336 }