t6030: grab commit object name as we go
Instead of running rev-list and picking earlier lines using head/tail pipeline, grab commit object name as we build commits. This also removes a non POSIX use of tail with -linenum (more posixly-correct way to say it is "-n linenum") Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Apr 23, 2007 at 22:10 UTC
ab69e89c7e95f309564c3967222bd39f0587a74c
1 file changed
+10
-7
t/t6030-bisect-porcelain.sh
+10
-7
@@ -22,22 +22,25 @@ add_line_into_file()
22
MSG="Create file <$_file> with <$_line> inside."
23
fi
24
25
- git-commit -m "$MSG" $_file
25
+ test_tick
26
+ git-commit --quiet -m "$MSG" $_file
27
}
28
29
HASH1=
30
+HASH2=
31
HASH3=
32
HASH4=
33
32
-test_expect_success \
33
- 'set up basic repo with 1 file (hello) and 4 commits' \
34
- 'add_line_into_file "1: Hello World" hello &&
34
+test_expect_success 'set up basic repo with 1 file (hello) and 4 commits' '
35
+ add_line_into_file "1: Hello World" hello &&
36
+ HASH1=$(git rev-parse --verify HEAD) &&
37
add_line_into_file "2: A new day for git" hello &&
38
+ HASH2=$(git rev-parse --verify HEAD) &&
39
add_line_into_file "3: Another new day for git" hello &&
40
+ HASH3=$(git rev-parse --verify HEAD) &&
41
add_line_into_file "4: Ciao for now" hello &&
38
- HASH1=$(git rev-list HEAD | tail -1) &&
39
- HASH3=$(git rev-list HEAD | head -2 | tail -1) &&
40
- HASH4=$(git rev-list HEAD | head -1)'
42
+ HASH4=$(git rev-parse --verify HEAD)
43
+'
44
45
test_expect_success 'bisect starts with only one bad' '
46
git bisect reset &&