mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
update per shellcheck advice
This commit is contained in:
parent
8c744569c4
commit
34237934d4
|
|
@ -19,7 +19,7 @@ if [ "$1" = "--touch" ]; then
|
|||
git_s=$(git --no-pager log --no-renames --pretty=format:%ct -1 @ -- "$f" 2>/dev/null)
|
||||
mod_s=$(stat $stat_flags "$f" 2>/dev/null)
|
||||
if [ -n "$git_s" ] && [ -n "$mod_s" ] && [ "$mod_s" -ne "$git_s" ]; then
|
||||
if [ "$mod_s" -gt "$git_s" ] || [ ! -n "$newer_flag" ]; then
|
||||
if [ "$mod_s" -gt "$git_s" ] || [ -z "$newer_flag" ]; then
|
||||
t=$(date $date_flags$git_s '+%Y%m%d%H%M.%S')
|
||||
echo "+ touch -h -t $t $f" >&2
|
||||
touch -h -t "$t" "$f"
|
||||
|
|
@ -32,7 +32,6 @@ else
|
|||
# `-n` should be limited or parallelization will not give effect,
|
||||
# because all args will go into single worker.
|
||||
NPROC=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null)
|
||||
# shellcheck disable=SC2086
|
||||
# don't touch files that have been modified in the worktree or index
|
||||
# bsd doesn't have `-z` option for `comm` and `cut`, so use `tr` as work around
|
||||
prefix="$(git rev-parse --show-prefix) "
|
||||
|
|
|
|||
Loading…
Reference in a new issue