path: root/builtin/fetch.c
diff options
authorMichael Haggerty <>2013-10-30 05:33:04 (GMT)
committerJunio C Hamano <>2013-10-30 21:16:41 (GMT)
commit90765fa3e01658ac2fb75a4eb740cee7dad4a2dc (patch)
tree0c9b8335b6ea86f4241e4123a226e9b24b791fa9 /builtin/fetch.c
parent8607590e74814c6c6a352cbd099e2617a69bb2c6 (diff)
fetch, remote: properly convey --no-prune options to subprocesses
If --no-prune is passed to one of the following commands: git fetch --all git fetch --multiple git fetch --recurse-submodules git remote update then it must also be passed to the "fetch" subprocesses that those commands use to do their work. Otherwise there might be a fetch.prune or remote.<name>.prune configuration setting that causes pruning to occur, contrary to the user's express wish. Signed-off-by: Michael Haggerty <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/fetch.c')
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 1514b90..5ddb9af 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -936,8 +936,8 @@ static void add_options_to_argv(struct argv_array *argv)
if (dry_run)
argv_array_push(argv, "--dry-run");
- if (prune > 0)
- argv_array_push(argv, "--prune");
+ if (prune != -1)
+ argv_array_push(argv, prune ? "--prune" : "--no-prune");
if (update_head_ok)
argv_array_push(argv, "--update-head-ok");
if (force)