[PATCHv10 02/10] receive-pack.c: die instead of error in assure_connectivity_checked
- From
Stefan Beller <sbeller@google.com>
- Date
- Jan 5, 2015, 18:25 UTC
- Message-ID
- <1420482355-24995-2-git-send-email-sbeller@google.com>
- In-Reply-To
- <1420482355-24995-1-git-send-email-sbeller@google.com>
Discussion on the previous patch revealed we rather want to err on the safe side. To do so we need to stop receive-pack in case of the possible future bug when connectivity is not checked on a shallow push.
Suggested-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Stefan Beller <sbeller@google.com> ---
Notes:
v10:
* new in v10.builtin/receive-pack.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index ed428e4..7ebea7f 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -1055,15 +1055,15 @@ static void assure_connectivity_checked(struct command *commands, for (cmd = commands; cmd; cmd = cmd->next) { if (should_process_cmd(cmd) && si->shallow_ref[cmd->index]) { - error("BUG: connectivity check has not been run on ref %s", - cmd->ref_name); + die("BUG: connectivity check has not been run on ref %s", + cmd->ref_name); checked_connectivity = 0; } } if (!checked_connectivity) - error("BUG: run 'git fsck' for safety.\n" - "If there are errors, try to remove " - "the reported refs above"); + die("BUG: run 'git fsck' for safety.\n" + "If there are errors, try to remove " + "the reported refs above"); } static void execute_commands(struct command *commands,
-- 2.2.1.62.g3f15098