|
9 | 9 | # You can specify a base git revision to compare against (i.e. to use when |
10 | 10 | # determining whether or not a line is considered to have "changed"). To make |
11 | 11 | # the tool more consistent, it actually diffs against the most recent common |
12 | | -# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're |
13 | | -# actually diffing against the output of 'git merge-base origin/master HEAD'. |
| 12 | +# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're |
| 13 | +# actually diffing against the output of 'git merge-base origin/main HEAD'. |
14 | 14 | # |
15 | 15 | # If you don't specify a base revision, the following defaults will be tried, |
16 | 16 | # in order, until one exists: |
17 | 17 | # |
18 | | -# 1. upstream/master |
19 | | -# 2. origin/master |
20 | | -# 3. master |
| 18 | +# 1. upstream/main |
| 19 | +# 2. origin/main |
| 20 | +# 3. main |
21 | 21 | # |
22 | 22 | # If none exists, the script fails. |
23 | 23 | ################################################################################ |
@@ -50,14 +50,14 @@ if [ -n "${BASEREV}" ]; then |
50 | 50 | exit 1 |
51 | 51 | fi |
52 | 52 | rev="${BASEREV}" |
53 | | -elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then |
54 | | - rev=upstream/master |
55 | | -elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then |
56 | | - rev=origin/master |
57 | | -elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then |
58 | | - rev=master |
| 53 | +elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then |
| 54 | + rev=upstream/main |
| 55 | +elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then |
| 56 | + rev=origin/main |
| 57 | +elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then |
| 58 | + rev=main |
59 | 59 | else |
60 | | - echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2 |
| 60 | + echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2 |
61 | 61 | exit 1 |
62 | 62 | fi |
63 | 63 | base="$(git merge-base "${rev}" HEAD)" |
|
0 commit comments