Skip to content

Commit

Permalink
receive-pack.c: die instead of error in case of possible future bug
Browse files Browse the repository at this point in the history
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.

Also while touching that code we considered that removing the reported
refs may be harmful in some situations. Sound the message more like a
"This Cannot Happen, Please Investigate!" instead of giving advice to
remove refs.

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Stefan Beller authored and Junio C Hamano committed Jan 8, 2015
1 parent a6a8431 commit b6a4788
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions builtin/receive-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,9 +1061,7 @@ static void warn_if_skipped_connectivity_check(struct command *commands,
}
}
if (!checked_connectivity)
error("BUG: run 'git fsck' for safety.\n"
"If there are errors, try to remove "
"the reported refs above");
die("BUG: connectivity check skipped???");
}

static void execute_commands(struct command *commands,
Expand Down

0 comments on commit b6a4788

Please sign in to comment.