diff options
author | Josh England <jjengla@sandia.gov> | 2007-09-26 15:31:01 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-09-29 21:11:21 -0700 |
commit | 1abbe475ff17349839f72a024cf665b8ec86473f (patch) | |
tree | 19b2213ce48607549de06689c43f31a581a6e41c /git-checkout.sh | |
parent | 2a858ee95134926a0ccccb9a78db06bcb0bd65d0 (diff) | |
download | git-1abbe475ff17349839f72a024cf665b8ec86473f.tar.gz |
post-checkout hook, tests, and docs
Updated post-checkout hook to take a flag specifying whether the checkout is
a branch checkout or a file checkout (from the index).
Signed-off-by: Josh England <jjengla@sandia.gov>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-checkout.sh')
-rwxr-xr-x | git-checkout.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/git-checkout.sh b/git-checkout.sh index 17f43927aa..8993920673 100755 --- a/git-checkout.sh +++ b/git-checkout.sh @@ -137,6 +137,13 @@ Did you intend to checkout '$@' which can not be resolved as commit?" git ls-files --error-unmatch -- "$@" >/dev/null || exit git ls-files -- "$@" | git checkout-index -f -u --stdin + + # Run a post-checkout hook -- the HEAD does not change so the + # current HEAD is passed in for both args + if test -x "$GIT_DIR"/hooks/post-checkout; then + "$GIT_DIR"/hooks/post-checkout $old $old 0 + fi + exit $? else # Make sure we did not fall back on $arg^{tree} codepath @@ -284,3 +291,8 @@ if [ "$?" -eq 0 ]; then else exit 1 fi + +# Run a post-checkout hook +if test -x "$GIT_DIR"/hooks/post-checkout; then + "$GIT_DIR"/hooks/post-checkout $old $new 1 +fi |