Skip to content

Commit 66e5e13

Browse files
committed
Fix empty assignment, bare variables and read lint warning
1 parent 5465fab commit 66e5e13

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

bin/git-show-overwritten

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ abort() {
2929
while [ "$#" -gt 0 ]; do
3030
case "$1" in
3131
--color ) colorize=1 ;;
32-
--no-color ) colorize= ;;
32+
--no-color ) colorize='';;
3333
-h | --help )
3434
sed -ne '/^#/!q;s/.\{1,2\}//;1d;p' < "$0"
3535
exit 0
@@ -101,14 +101,16 @@ git diff "${base}...${head}" --diff-filter=DM --no-prefix -w -U0 | grep -v '^+'
101101
}
102102
END { print num_lines, name_length }
103103
' | sort -n | {
104+
# shellcheck disable=SC2162
104105
read num_lines name_length
105106
if [ "$num_lines" -eq 0 ]; then
106107
color 31 "Warning: " >&2
107108
echo "no changed/removed lines found in the $base...$head diff" >&2
108109
fi
109110

111+
# shellcheck disable=SC2162
110112
while IFS=$'\t' read time sha author msg; do
111-
date -r $time "+%Y-%m-%d" | tr -d $'\n'
113+
date -r "$time" "+%Y-%m-%d" | tr -d $'\n'
112114
printf ' '
113115
color 33 "${sha:0:7}"
114116
printf ' '

0 commit comments

Comments
 (0)