Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh England <jjengla@sandia.gov>2007-09-27 01:31:01 +0400
committerJunio C Hamano <gitster@pobox.com>2007-09-30 08:11:21 +0400
commit1abbe475ff17349839f72a024cf665b8ec86473f (patch)
tree19b2213ce48607549de06689c43f31a581a6e41c /git-checkout.sh
parent2a858ee95134926a0ccccb9a78db06bcb0bd65d0 (diff)
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-xgit-checkout.sh12
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