From 7bb55251674b42b4a0dc91a8072fbd1000306628 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sat, 20 May 2006 21:07:44 +0200 Subject: [PATCH] Move git directory assertion to main; don't require .git repo in pager mode --- tig.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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); -- 2.30.2