Skip to content

Commit f1c55ef

Browse files
committed
Update branch status for branch renames.
1 parent 302a2bc commit f1c55ef

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

branch-status.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
master_only=1
3+
main_only=1
44
folder=""
55
if [ ! -z $1 ]; then
66
cd $1
@@ -35,18 +35,18 @@ do
3535
fi
3636

3737
for branch in ${branches[@]}; do
38-
master="origin/master"
39-
if [ $branch == $master ]; then
38+
main="origin/main"
39+
if [ $branch == $main ]; then
4040
continue
4141
fi
42-
if [ $master_only == 1 ]; then
43-
if [ $branch != "master" ]; then
42+
if [ $main_only == 1 ]; then
43+
if [ $branch != "main" ]; then
4444
continue
4545
fi
4646
fi
47-
git rev-list --left-right ${branch}...${master} -- 2>/dev/null >${temp_file} || continue
47+
git rev-list --left-right ${branch}...${main} -- 2>/dev/null >${temp_file} || continue
4848
LEFT_AHEAD=$(grep -c '^<' ${temp_file})
4949
RIGHT_AHEAD=$(grep -c '^>' ${temp_file})
50-
printf "%s (ahead %s) | (behind %s) %s %-16s%s\n" $branch $LEFT_AHEAD $RIGHT_AHEAD $master $folder $mods
50+
printf "%s (ahead %s) | (behind %s) %s %-16s%s\n" $branch $LEFT_AHEAD $RIGHT_AHEAD $main $folder $mods
5151
done
5252
done

0 commit comments

Comments
 (0)