Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2018-05-19 01:25:53 +0300
committerJunio C Hamano <gitster@pobox.com>2018-05-21 03:45:23 +0300
commit2dc417ab1fa87cbab99eaf8a293380fa763dcd2b (patch)
tree252a9b4d04f341686d78d62faaa8e08c276b6fbe /replace-object.c
parent7a1dc605af0d76b6de5832f1a2c1587e693de6df (diff)
get_main_ref_store: BUG() when outside a repository
If we don't have a repository, then we can't initialize the ref store. Prior to 64a741619d (refs: store the main ref store inside the repository struct, 2018-04-11), we'd try to access get_git_dir(), and outside a repository that would trigger a BUG(). After that commit, though, we directly use the_repository->git_dir; if it's NULL we'll just segfault. Let's catch this case and restore the BUG() behavior. Obviously we don't ever want to hit this code, but a BUG() is a lot more helpful than a segfault if we do. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'replace-object.c')
0 files changed, 0 insertions, 0 deletions