Skip to content

Commit b8dde37

Browse files
committed
Fix shellcheck
1 parent 70ad965 commit b8dde37

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

git-ls-blame

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ done
1313
items=$(git ls-files | cut -d/ -f1 | sort -u)
1414

1515
# Get current year and 6 months ago timestamp for comparison
16-
current_year=$(date +%Y)
1716
six_months_ago=$(date -v-6m +%s 2>/dev/null || date -d '6 months ago' +%s)
1817

1918
# First pass: collect data and find max filename length
@@ -47,7 +46,7 @@ while read -r item; do
4746

4847
# Track max length
4948
len=${#display_name}
50-
[ $len -gt $max_len ] && max_len=$len
49+
[ "$len" -gt "$max_len" ] && max_len=$len
5150
fi
5251
done <<< "$items"
5352

@@ -61,6 +60,6 @@ sort_opts="-r"
6160
IFS='|' read -r name hash full_date date msg <<< "$line"
6261
printf "%s|%-${max_len}s|%s|%s|%s\n" "$full_date" "$name" "$hash" "$date" "$msg"
6362
done
64-
) | sort $sort_opts | while IFS='|' read -r sortkey name hash date msg; do
63+
) | sort $sort_opts | while IFS='|' read -r _ name hash date msg; do
6564
printf "\033[32m%-${max_len}s\033[0m \033[33m%s\033[0m %s %s\n" "$name" "$hash" "$date" "$msg"
6665
done

0 commit comments

Comments
 (0)