mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
parent
ff0b1cfb0b
commit
7015501161
|
|
@ -177,10 +177,6 @@ fi
|
|||
args_to_git_log="${args_to_git_log#\ \'\'}"
|
||||
export args_to_git_log
|
||||
|
||||
# set column width to match longest filename
|
||||
columns=$(( $(git ls-files | awk '{ print length }' | sort -rn | head -1 ) + 5 ))
|
||||
export columns
|
||||
|
||||
# [path ...]
|
||||
|
||||
if test "${#paths}" -eq 0; then
|
||||
|
|
@ -191,6 +187,17 @@ if test "${#paths}" -eq 0; then
|
|||
unset save_ifs
|
||||
fi
|
||||
|
||||
# set column width to match longest filename
|
||||
max=0
|
||||
for path in "${paths[@]}"; do
|
||||
cur=${#path}
|
||||
if [[ $max -lt $cur ]]; then
|
||||
max=$cur
|
||||
fi
|
||||
done
|
||||
columns=$(( max + 5 ))
|
||||
export columns
|
||||
|
||||
# hide cursor
|
||||
|
||||
hide_cursor
|
||||
|
|
|
|||
Loading…
Reference in a new issue