path: root/builtin/checkout.c
diff options
authorEdward Thomson <>2016-05-31 22:08:18 (GMT)
committerJunio C Hamano <>2016-06-08 00:43:39 (GMT)
commit4e55ed32db81d06a4f618e2cc0f9da0e223ae304 (patch)
tree3316fb763bd68cde0303b6ef964a1dac214d3668 /builtin/checkout.c
parent60bd4b1c513bb652cdffad44382046ca872140eb (diff)
add: add --chmod=+x / --chmod=-x options
The executable bit will not be detected (and therefore will not be set) for paths in a repository with `core.filemode` set to false, though the users may still wish to add files as executable for compatibility with other users who _do_ have `core.filemode` functionality. For example, Windows users adding shell scripts may wish to add them as executable for compatibility with users on non-Windows. Although this can be done with a plumbing command (`git update-index --add --chmod=+x foo`), teaching the `git-add` command allows users to set a file executable with a command that they're already familiar with. Signed-off-by: Edward Thomson <> Helped-by: Johannes Schindelin <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/checkout.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index 3398c61..c3486bd 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -548,7 +548,7 @@ static int merge_working_tree(const struct checkout_opts *opts,
* entries in the index.
- add_files_to_cache(NULL, NULL, 0);
+ add_files_to_cache(NULL, NULL, 0, 0);
* NEEDSWORK: carrying over local changes
* when branches have different end-of-line