From: Jonas Fonseca Date: Sat, 20 May 2006 19:07:44 +0000 (+0200) Subject: Move git directory assertion to main; don't require .git repo in pager mode X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7bb55251674b42b4a0dc91a8072fbd1000306628;p=tig.git Move git directory assertion to main; don't require .git repo in pager mode --- diff --git a/tig.c b/tig.c index 3c267af..be165b9 100644 --- a/tig.c +++ b/tig.c @@ -2297,9 +2297,6 @@ load_refs(void) pclose(pipe); - if (refs_size == 0) - die("Not a git repository"); - return OK; } @@ -2353,6 +2350,10 @@ main(int argc, char *argv[]) if (load_refs() == ERR) die("Failed to load refs."); + /* Require a git repository unless when running in pager mode. */ + if (refs_size == 0 && opt_request != REQ_VIEW_PAGER) + die("Not a git repository"); + for (i = 0; i < ARRAY_SIZE(views) && (view = &views[i]); i++) view->cmd_env = getenv(view->cmd_env);