Use if instead of && in git hooks (#680)
This prevents a Git hook from issuing a non-zero exit status if the condition is the last line of the hook.
This commit is contained in:
parent
de02da4fc6
commit
2a59c1890f
3 changed files with 12 additions and 3 deletions
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
local_hook="$HOME"/.git_template.local/hooks/post-checkout
|
local_hook="$HOME"/.git_template.local/hooks/post-checkout
|
||||||
[ -f "$local_hook" ] && . "$local_hook"
|
|
||||||
|
if [ -f "$local_hook" ]; then
|
||||||
|
. "$local_hook";
|
||||||
|
fi
|
||||||
|
|
||||||
.git/hooks/ctags >/dev/null 2>&1 &
|
.git/hooks/ctags >/dev/null 2>&1 &
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
local_hook="$HOME"/.git_template.local/hooks/post-commit
|
local_hook="$HOME"/.git_template.local/hooks/post-commit
|
||||||
[ -f "$local_hook" ] && . "$local_hook"
|
|
||||||
|
if [ -f "$local_hook" ]; then
|
||||||
|
. "$local_hook";
|
||||||
|
fi
|
||||||
|
|
||||||
.git/hooks/ctags >/dev/null 2>&1 &
|
.git/hooks/ctags >/dev/null 2>&1 &
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
local_hook="$HOME"/.git_template.local/hooks/post-merge
|
local_hook="$HOME"/.git_template.local/hooks/post-merge
|
||||||
[ -f "$local_hook" ] && . "$local_hook"
|
|
||||||
|
if [ -f "$local_hook" ]; then
|
||||||
|
. "$local_hook";
|
||||||
|
fi
|
||||||
|
|
||||||
.git/hooks/ctags >/dev/null 2>&1 &
|
.git/hooks/ctags >/dev/null 2>&1 &
|
||||||
|
|
Loading…
Add table
Reference in a new issue