3131#
3232# You can specify a base git revision to compare against (i.e. to use when
3333# determining whether or not a file is considered to have "changed"). For
34- # example, you can compare against 'origin/master ' or 'HEAD~1'.
34+ # example, you can compare against 'origin/main ' or 'HEAD~1'.
3535#
3636# If you don't specify a base revision, the following defaults will be tried, in
3737# order, until one exists:
3838#
39- # 1. upstream/master
40- # 2. origin/master
41- # 3. master
39+ # 1. upstream/main
40+ # 2. origin/main
41+ # 3. main
4242#
4343# If none exists, the script fails.
4444# ###############################################################################
@@ -48,7 +48,6 @@ thisdir="$(dirname "${BASH_SOURCE[0]}")" || exit $?
4848topdir=" $( git -C " ${thisdir} " rev-parse --show-toplevel) " || exit $?
4949cd " ${topdir} " || exit $?
5050
51-
5251# Parse arguments.
5352only_print=1
5453only_changed=1
@@ -74,14 +73,14 @@ typeset -a format_files
7473if (( only_changed == 1 )) ; then
7574 # Figure out which branch to compare against.
7675 if [ -z " ${rev} " ]; then
77- if [ " $( git cat-file -t upstream/master 2> /dev/null) " == " commit" ]; then
78- rev=upstream/master
79- elif [ " $( git cat-file -t origin/master 2> /dev/null) " == " commit" ]; then
80- rev=origin/master
81- elif [ " $( git cat-file -t master 2> /dev/null) " == " commit" ]; then
82- rev=master
76+ if [ " $( git cat-file -t upstream/main 2> /dev/null) " == " commit" ]; then
77+ rev=upstream/main
78+ elif [ " $( git cat-file -t origin/main 2> /dev/null) " == " commit" ]; then
79+ rev=origin/main
80+ elif [ " $( git cat-file -t main 2> /dev/null) " == " commit" ]; then
81+ rev=main
8382 else
84- 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
83+ 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
8584 exit 1
8685 fi
8786 fi
0 commit comments