summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89de1d4)
raw | patch | inline | side by side (parent: 89de1d4)
author | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 3 Jun 2007 12:31:55 +0000 (14:31 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Sun, 3 Jun 2007 12:31:55 +0000 (14:31 +0200) |
tig.c | patch | blob | history |
index 4150696800462c9bb442864b664b1d06931aa46c..6adfb334e9d3546511ffc737a2e89621f50631fc 100644 (file)
--- a/tig.c
+++ b/tig.c
static int
load_repo_info(void)
{
- return read_properties(popen("git rev-parse --git-dir --show-cdup", "r"),
+ return read_properties(popen("git rev-parse --git-dir --show-cdup 2>/dev/null", "r"),
"=", read_repo_info);
}
string_ncopy(opt_codeset, codeset, strlen(codeset));
}
+ if (load_repo_info() == ERR)
+ die("Failed to load repo info.");
+
+ /* Require a git repository unless when running in pager mode. */
+ if (!opt_git_dir[0])
+ die("Not a git repository");
+
if (load_options() == ERR)
die("Failed to load user config.");
if (load_repo_config() == ERR)
die("Failed to load repo config.");
- if (load_repo_info() == ERR)
- die("Failed to load repo info.");
-
if (!parse_options(argc, argv))
return 0;
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);