Merge pull request #768 from bric3/fix-more-character-encoding-issues

git-guilt: protect against encoding issues with LC_ALL=C
This commit is contained in:
罗泽轩 2019-07-19 09:28:23 +08:00 committed by GitHub
commit f2587339cf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,10 +45,10 @@ do
test -n "$DEBUG" && echo "git blame $file"
# $1 - since $2 - until
git blame $NOT_WHITESPACE --line-porcelain "$1" -- "$file" 2> /dev/null |
sed -n "$PATTERN" | sort | uniq -c | sed 's/^\(.\)/- \1/' >> $MERGED_LOG
LC_ALL=C sed -n "$PATTERN" | sort | uniq -c | LC_ALL=C sed 's/^\(.\)/- \1/' >> $MERGED_LOG
# if $2 not given, use current commit as "until"
git blame $NOT_WHITESPACE --line-porcelain "${2-@}" -- "$file" 2> /dev/null |
sed -n "$PATTERN" | sort | uniq -c | sed 's/^\(.\)/+ \1/' >> $MERGED_LOG
LC_ALL=C sed -n "$PATTERN" | sort | uniq -c | LC_ALL=C sed 's/^\(.\)/+ \1/' >> $MERGED_LOG
done
DEBUG="$DEBUG" awk '