stash: teach 'push' (and 'create_stash') to honor pathspec
[git.git] / templates / hooks--pre-receive.sample
bloba1fd29ec14823d8bc4a8d1a2cfe35451580f5118
1 #!/bin/sh
3 # An example hook script to make use of push options.
4 # The example simply echoes all push options that start with 'echoback='
5 # and rejects all pushes when the "reject" push option is used.
7 # To enable this hook, rename this file to "pre-receive".
9 if test -n "$GIT_PUSH_OPTION_COUNT"
10 then
11 i=0
12 while test "$i" -lt "$GIT_PUSH_OPTION_COUNT"
14 eval "value=\$GIT_PUSH_OPTION_$i"
15 case "$value" in
16 echoback=*)
17 echo "echo from the pre-receive-hook: ${value#*=}" >&2
19 reject)
20 exit 1
21 esac
22 i=$((i + 1))
23 done