From a33679f95fc812dece2b2f4ee707a0bf6abc79cb Mon Sep 17 00:00:00 2001 From: William Petit Date: Mon, 13 Jul 2015 15:19:27 +0200 Subject: [PATCH] Fix git shortlog bug --- get-updated-manifest-from-git.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/get-updated-manifest-from-git.sh b/get-updated-manifest-from-git.sh index 310bed3..60832b1 100755 --- a/get-updated-manifest-from-git.sh +++ b/get-updated-manifest-from-git.sh @@ -12,11 +12,9 @@ function show_usage { function main { - cd $SRC_DIR + cd "$SRC_DIR" - git status 2>&1 1>/dev/null - - if [ $? != 0 ]; then + if [ ! -d '.git' ]; then fatal "The directory $SRC_DIR seems not to be a valid Git repository." fi @@ -30,7 +28,7 @@ function main { repo_name=$(basename `git rev-parse --show-toplevel`) current_commit=$(git log -n 1 --pretty=format:"%h") logs=$(git log --pretty=format:"%an - %h : %s" | sed 's/"/\\"/g') - git_maintainer=$(git shortlog -s -n -e 2>&1 | sed 's/^\s*[0-9]*\s*//g' | head -n 1) + git_maintainer=$(git shortlog -s -n -e 2>&1 < /dev/tty | sed 's/^\s*[0-9]*\s*//g' | head -n 1) # Get current version from manifest current_name=$(echo "$MANIFEST" | jq -r ".name" | sed 's/null//') @@ -62,7 +60,6 @@ function main { } - # Load util lib DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) source "$DIR/lib/util.sh"