diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-01-23 21:19:25 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-01-23 21:19:25 -0800 |
commit | bb9a69694f27aa299777c679979f75bdef75735d (patch) | |
tree | f00e9f412cd91c4f2b5aa355d68bc0b501ff8ee3 /builtin/commit.c | |
parent | 86db7464496ca82488071c7a9e7e57eff07cd900 (diff) | |
parent | 87c86dd14abe8db7d00b0df5661ef8cf147a72a3 (diff) | |
download | git-bb9a69694f27aa299777c679979f75bdef75735d.tar.gz |
Merge branch 'as/pre-push-hook'
Add an extra hook so that "git push" that is run without making
sure what is being pushed is sane can be checked and rejected (as
opposed to the user deciding not pushing).
* as/pre-push-hook:
Add sample pre-push hook script
push: Add support for pre-push hooks
hooks: Add function to check if a hook exists
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 7c2a3d48b4..38b9a9cc0d 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1329,8 +1329,6 @@ static int git_commit_config(const char *k, const char *v, void *cb) return git_status_config(k, v, s); } -static const char post_rewrite_hook[] = "hooks/post-rewrite"; - static int run_rewrite_hook(const unsigned char *oldsha1, const unsigned char *newsha1) { @@ -1341,10 +1339,10 @@ static int run_rewrite_hook(const unsigned char *oldsha1, int code; size_t n; - if (access(git_path(post_rewrite_hook), X_OK) < 0) + argv[0] = find_hook("post-rewrite"); + if (!argv[0]) return 0; - argv[0] = git_path(post_rewrite_hook); argv[1] = "amend"; argv[2] = NULL; |