summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-03-14 05:56:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-03-14 05:56:02 (GMT)
commit5244a31039dbb3fe0d544fc56100d0ccbc653131 (patch)
tree47362bd61deab37c7dfb41d1b8189e31ccab5ccb /Documentation
parent1469d9906833a8bd7d07a70ba8250c823716f20a (diff)
parente0d201b61601e17e24ed00cc3d16e8e25ca68596 (diff)
downloadgit-5244a31039dbb3fe0d544fc56100d0ccbc653131.zip
git-5244a31039dbb3fe0d544fc56100d0ccbc653131.tar.gz
git-5244a31039dbb3fe0d544fc56100d0ccbc653131.tar.bz2
Merge branch 'jc/apply-beyond-symlink' into maint
"git apply" was not very careful about reading from, removing, updating and creating paths outside the working tree (under --index/--cached) or the current directory (when used as a replacement for GNU patch). * jc/apply-beyond-symlink: apply: do not touch a file beyond a symbolic link apply: do not read from beyond a symbolic link apply: do not read from the filesystem under --index apply: reject input that touches outside the working area
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/git-apply.txt12
1 files changed, 11 insertions, 1 deletions
diff --git a/Documentation/git-apply.txt b/Documentation/git-apply.txt
index f605327..9489664 100644
--- a/Documentation/git-apply.txt
+++ b/Documentation/git-apply.txt
@@ -16,7 +16,7 @@ SYNOPSIS
[--ignore-space-change | --ignore-whitespace ]
[--whitespace=(nowarn|warn|fix|error|error-all)]
[--exclude=<path>] [--include=<path>] [--directory=<root>]
- [--verbose] [<patch>...]
+ [--verbose] [--unsafe-paths] [<patch>...]
DESCRIPTION
-----------
@@ -229,6 +229,16 @@ For example, a patch that talks about updating `a/git-gui.sh` to `b/git-gui.sh`
can be applied to the file in the working tree `modules/git-gui/git-gui.sh` by
running `git apply --directory=modules/git-gui`.
+--unsafe-paths::
+ By default, a patch that affects outside the working area
+ (either a Git controlled working tree, or the current working
+ directory when "git apply" is used as a replacement of GNU
+ patch) is rejected as a mistake (or a mischief).
++
+When `git apply` is used as a "better GNU patch", the user can pass
+the `--unsafe-paths` option to override this safety check. This option
+has no effect when `--index` or `--cached` is in use.
+
Configuration
-------------