Fixed GIT_DIR for git hooks that don't have it

This commit is contained in:
Talia 2021-09-14 10:50:36 +02:00
parent c580a5d27c
commit 7245177157
11 changed files with 45 additions and 1 deletions

View File

@ -1,8 +1,11 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,7 +1,12 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook
$GIT_DIR/hooks/$hook
fi

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook

View File

@ -1,5 +1,9 @@
#!/bin/sh
hook=$(basename $0)
if [ -z "$GIT_DIR" ]
then
GIT_DIR=$(git rev-parse --show-toplevel)/.git
fi
if [ -f $GIT_DIR/hooks/$hook ]
then
echo Running project-level hook: $GIT_DIR/hooks/$hook