From 5e09d5da0056f7fb94b6ba390c5605f1f7372883 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Wed, 14 Sep 2022 18:42:50 +0200 Subject: [PATCH] feat(rev-parse): silence --- gitapper.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gitapper.sh b/gitapper.sh index e54504b..01d2909 100755 --- a/gitapper.sh +++ b/gitapper.sh @@ -21,6 +21,11 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" GITAPPER_HOOKS="$DIR/hooks" GIT=$(which -a git | head -1) +if [[ "${PARAMETERS}" == "rev-parse --abbrev-ref HEAD" ]]; then + eval $GIT $PARAMETERS 2> /dev/null + exit 1 +fi + source $DIR/lib/forgit.sh function exec_hook() { @@ -47,7 +52,11 @@ if [ "$GIT" = "" ]; then fi # General: Do not run hooks for --help or nw -if [[ "${PARAMETERS}" == *"--help"* || "${PARAMETERS}" == *"--nw"* || "${PARAMETERS}" == *"-n"* || "${PARAMETERS}" == *"gitapper"* ]]; then +if [[ "${PARAMETERS}" == *"--help"* || + "${PARAMETERS}" == *"--nw"* || + "${PARAMETERS}" == *"-n"* || + "${PARAMETERS}" == *"gitapper"* + ]]; then ARGS='' ARG='' # Remove --nw parameter and pass to git