chiark
/
gitweb
/
~mdw
/
tig
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
89de1d4
)
Only emit one "Not a git repository" error message
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
|
blame
|
history
diff --git
a/tig.c
b/tig.c
index 4150696800462c9bb442864b664b1d06931aa46c..6adfb334e9d3546511ffc737a2e89621f50631fc 100644
(file)
--- a/
tig.c
+++ b/
tig.c
@@
-4089,7
+4089,7
@@
read_repo_info(char *name, size_t namelen, char *value, size_t valuelen)
static int
load_repo_info(void)
{
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);
}
"=", read_repo_info);
}
@@
-4178,6
+4178,13
@@
main(int argc, char *argv[])
string_ncopy(opt_codeset, codeset, strlen(codeset));
}
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_options() == ERR)
die("Failed to load user config.");
@@
-4186,9
+4193,6
@@
main(int argc, char *argv[])
if (load_repo_config() == ERR)
die("Failed to load repo 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 (!parse_options(argc, argv))
return 0;
@@
-4201,10
+4205,6
@@
main(int argc, char *argv[])
if (load_refs() == ERR)
die("Failed to load refs.");
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);
for (i = 0; i < ARRAY_SIZE(views) && (view = &views[i]); i++)
view->cmd_env = getenv(view->cmd_env);