summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-02-18 13:53:27 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-02-18 13:53:27 -0800
commit867b520301cc5e719b575edde7736ebe70a19298 (patch)
tree518a7677382c18be1913971a955311babd9dfe9d /builtin/receive-pack.c
parentThe fifth batch (diff)
parentreceive-pack: purge temporary data if no command is ready to run (diff)
downloadtgif-867b520301cc5e719b575edde7736ebe70a19298.tar.xz
Merge branch 'cb/clear-quarantine-early-on-all-ref-update-errors'
"receive-pack" checks if it will do any ref updates (various conditions could reject a push) before received objects are taken out of the temporary directory used for quarantine purposes, so that a push that is known-to-fail will not leave crufts that a future "gc" needs to clean up. * cb/clear-quarantine-early-on-all-ref-update-errors: receive-pack: purge temporary data if no command is ready to run
Diffstat (limited to 'builtin/receive-pack.c')
-rw-r--r--builtin/receive-pack.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index c427ca09aa..d10aeb7e78 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1962,6 +1962,15 @@ static void execute_commands(struct command *commands,
}
/*
+ * If there is no command ready to run, should return directly to destroy
+ * temporary data in the quarantine area.
+ */
+ for (cmd = commands; cmd && cmd->error_string; cmd = cmd->next)
+ ; /* nothing */
+ if (!cmd)
+ return;
+
+ /*
* Now we'll start writing out refs, which means the objects need
* to be in their final positions so that other processes can see them.
*/