Thread (24 messages) flat view 24 messages, 3 authors, 2016-06-15

[PATCHv10 02/10] receive-pack.c: die instead of error in assure_connectivity_checked

From: Stefan Beller <hidden>
Date: 2016-06-15 23:03:23
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
Signed-off-by: Stefan Beller <redacted>
---

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help