Skip to content

Commit

Permalink
git-summary: protect against character encoding issues with LC_ALL=C
Browse files Browse the repository at this point in the history
  • Loading branch information
apjanke committed Oct 2, 2015
1 parent faaae9f commit 19f6694
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/git-line-summary
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
3 changes: 2 additions & 1 deletion bin/git-summary
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env bash


SUBDIRECTORY_OK=Yes
source "$(git --exec-path)/git-sh-setup"
cd_to_toplevel
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 19f6694

Please sign in to comment.