summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bc02ff8)
raw | patch | inline | side by side (parent: bc02ff8)
author | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 31 Mar 2008 17:51:02 +0000 (19:51 +0200) | ||
committer | Jonas Fonseca <fonseca@diku.dk> | |
Mon, 31 Mar 2008 17:51:02 +0000 (19:51 +0200) |
Also relax the opt_git_dir check.
tig.c | patch | blob | history |
index 466fc2dc2dbb1d1a8ab592cafa65be6dadbc474c..ece56281d8bd07d0cf4ab0ab42f6122966f79620 100644 (file)
--- a/tig.c
+++ b/tig.c
bool seen_dashdash = FALSE;
int i;
+ if (!isatty(STDIN_FILENO)) {
+ opt_request = REQ_VIEW_PAGER;
+ opt_pipe = stdin;
+ return TRUE;
+ }
+
if (argc <= 1)
return TRUE;
die("command too long");
}
- if (!isatty(STDIN_FILENO)) {
- opt_request = REQ_VIEW_PAGER;
- opt_pipe = stdin;
- buf_size = 0;
- }
-
opt_cmd[buf_size] = 0;
return TRUE;
return 0;
/* Require a git repository unless when running in pager mode. */
- if (!opt_git_dir[0])
+ if (!opt_git_dir[0] && opt_request != REQ_VIEW_PAGER)
die("Not a git repository");
if (*opt_encoding && strcasecmp(opt_encoding, "UTF-8"))