Skip to content

Commit dd7c611

Browse files
peffgitster
authored andcommitted
t8003: factor setup out of coalesce test
In preparation for adding more tests of blame's coalesce code, let's split the setup out from the first test, and give each of the commits a more meaningful name: - $orig for the original source that added the lines - $split for the version where they are split apart - $final for the final version that re-joins them That's not strictly necessary, but makes the follow-on tests less brittle than relying on HEAD^, etc, to name the commits. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6dbf0c7 commit dd7c611

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

t/t8003-blame-corner-cases.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,14 +274,14 @@ test_expect_success 'blame file with CRLF core.autocrlf=true' '
274274
grep "A U Thor" actual
275275
'
276276

277-
test_expect_success 'blame coalesce' '
277+
test_expect_success 'setup coalesce tests' '
278278
cat >giraffe <<-\EOF &&
279279
ABC
280280
DEF
281281
EOF
282282
git add giraffe &&
283283
git commit -m "original file" &&
284-
oid=$(git rev-parse HEAD) &&
284+
orig=$(git rev-parse HEAD) &&
285285
286286
cat >giraffe <<-\EOF &&
287287
ABC
@@ -290,20 +290,24 @@ test_expect_success 'blame coalesce' '
290290
EOF
291291
git add giraffe &&
292292
git commit -m "interior SPLIT line" &&
293+
split=$(git rev-parse HEAD) &&
293294
294295
cat >giraffe <<-\EOF &&
295296
ABC
296297
DEF
297298
EOF
298299
git add giraffe &&
299300
git commit -m "same contents as original" &&
301+
final=$(git rev-parse HEAD)
302+
'
300303

304+
test_expect_success 'blame coalesce' '
301305
cat >expect <<-EOF &&
302-
$oid 1 1 2
303-
$oid 2 2
306+
$orig 1 1 2
307+
$orig 2 2
304308
EOF
305-
git blame --porcelain giraffe >actual.raw &&
306-
grep "^$oid" actual.raw >actual &&
309+
git blame --porcelain $final giraffe >actual.raw &&
310+
grep "^$orig" actual.raw >actual &&
307311
test_cmp expect actual
308312
'
309313

0 commit comments

Comments
 (0)