repo-settings: prepare_repo_settings only in git repos
Check whether git directory exists before adding any repo settings. If it does not exist, BUG with the message that one cannot add settings for an uninitialized repository. If it does exist, proceed with adding repo settings. Signed-off-by: Lessley Dennington <lessleydennington@gmail.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
27a443b820
commit
44c7e62e51
@ -17,6 +17,9 @@ void prepare_repo_settings(struct repository *r)
|
||||
char *strval;
|
||||
int manyfiles;
|
||||
|
||||
if (!r->gitdir)
|
||||
BUG("Cannot add settings for uninitialized repository");
|
||||
|
||||
if (r->settings.initialized++)
|
||||
return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user