Fix a minor issue with "git-set-mtimes" on a dirty working tree
This commit is contained in:
parent
bd63adf3b7
commit
98c5d8cfe6
|
|
@ -6,6 +6,10 @@ files=( $({ git ls-files | xargs -n1 dirname | sort -u && git ls-files; } | sort
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
for f in "${files[@]}"; do
|
for f in "${files[@]}"; do
|
||||||
|
if [ ! -e "$f" ]; then
|
||||||
|
# don't try touching files that don't exist
|
||||||
|
continue
|
||||||
|
fi
|
||||||
stamp="$(git --no-pager log -1 --format='format:%ai' -- "$f")"
|
stamp="$(git --no-pager log -1 --format='format:%ai' -- "$f")"
|
||||||
touchFormat="$(date --date="$stamp" +'%Y%m%d%H%M.%S')"
|
touchFormat="$(date --date="$stamp" +'%Y%m%d%H%M.%S')"
|
||||||
touch --no-dereference -t "$touchFormat" "$f"
|
touch --no-dereference -t "$touchFormat" "$f"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue