git-summary: protect against character encoding issues with LC_ALL=C

This commit is contained in:
Andrew Janke 2015-10-02 08:35:04 -04:00
parent faaae9fa6b
commit 19f66943cb
2 changed files with 3 additions and 2 deletions

View file

@ -9,7 +9,7 @@ single_file() {
while read data
do
if [[ $(file "$data") = *text* ]]; then
git blame --line-porcelain "$data" 2>/dev/null | grep "^author\ " | sed -n 's/^author //p';
git blame --line-porcelain "$data" 2>/dev/null | grep "^author\ " | LC_ALL=C sed -n 's/^author //p';
fi
done
}

View file

@ -1,5 +1,6 @@
#!/usr/bin/env bash
SUBDIRECTORY_OK=Yes
source "$(git --exec-path)/git-sh-setup"
cd_to_toplevel
@ -63,7 +64,7 @@ authors() {
#
repository_age() {
git log --reverse --pretty=oneline --format="%ar" | head -n 1 | sed 's/ago//'
git log --reverse --pretty=oneline --format="%ar" | head -n 1 | LC_ALL=C sed 's/ago//'
}
# summary