Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/tests/git-bisect-test.sh
3544 views
1
#!/usr/bin/env bash
2
#
3
# Use this script to drive `git bisect run` to find the commit that introduced a behavior:
4
#
5
# - create a test that fails
6
# - `git bisect start`
7
# - `git bisect new` to mark the current commit as the new behavior
8
# - Find a commit that is known to have the old and run `git bisect old` from there
9
# - `git bisect run tests/git-bisect-test.sh <test-name> [flip]`
10
# - if `flip` is passed as the second argument, the script will return 1 on
11
# success and 0 on failure, so that the bisect will find the first commit
12
# that passes the test rather than the first commit that fails it
13
14
./configure.sh
15
cd tests
16
./run-fast-tests.sh $1
17
18
result=$?
19
20
if [ "$2" == "flip" ]; then
21
if [ $result -eq 0 ]; then
22
exit 1
23
else
24
exit 0
25
fi
26
else
27
if [ $result -eq 0 ]; then
28
exit 0
29
else
30
exit 1
31
fi
32
fi
33