summaryrefslogtreecommitdiff
path: root/Documentation/git-receive-pack.txt
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2017-04-10 22:14:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-04-17 01:19:18 (GMT)
commitd8f4481c4f03132174b514f428cd67d2cc0dc997 (patch)
tree70b6f8f9291109936af14988d23ebed5ced643bd /Documentation/git-receive-pack.txt
parenteaeed077a69ad1e26b0c329ac0f6cbd397f5be9e (diff)
downloadgit-d8f4481c4f03132174b514f428cd67d2cc0dc997.zip
git-d8f4481c4f03132174b514f428cd67d2cc0dc997.tar.gz
git-d8f4481c4f03132174b514f428cd67d2cc0dc997.tar.bz2
refs: reject ref updates while GIT_QUARANTINE_PATH is set
As documented in git-receive-pack(1), updating a ref from within the pre-receive hook is dangerous and can corrupt your repo. This patch forbids ref updates entirely during the hook to make it harder for adventurous hook writers to shoot themselves in the foot. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/git-receive-pack.txt')
-rw-r--r--Documentation/git-receive-pack.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt
index 7267ecf..86a4b32 100644
--- a/Documentation/git-receive-pack.txt
+++ b/Documentation/git-receive-pack.txt
@@ -239,7 +239,8 @@ This has a few user-visible effects and caveats:
3. The `pre-receive` hook MUST NOT update any refs to point to
quarantined objects. Other programs accessing the repository will
not be able to see the objects (and if the pre-receive hook fails,
- those refs would become corrupted).
+ those refs would become corrupted). For safety, any ref updates
+ from within `pre-receive` are automatically rejected.
SEE ALSO