Merge pull request #460 from apjanke/summary-defensive-locale

git-summary: protect against character encoding issues with LC_ALL=C
This commit is contained in:
hemanth.hm 2015-10-02 22:05:27 +05:30
commit c4cd2ca34d
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