~mdw
/
tig
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix pager mode by always doing the isatty()
[tig]
/
tig.c
diff --git
a/tig.c
b/tig.c
index
466fc2d
..
ece5628
100644
(file)
--- a/
tig.c
+++ b/
tig.c
@@
-466,6
+466,12
@@
parse_options(int argc, char *argv[])
bool seen_dashdash = FALSE;
int i;
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;
if (argc <= 1)
return TRUE;
@@
-534,12
+540,6
@@
parse_options(int argc, char *argv[])
die("command too long");
}
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;
opt_cmd[buf_size] = 0;
return TRUE;
@@
-5741,7
+5741,7
@@
main(int argc, char *argv[])
return 0;
/* Require a git repository unless when running in pager mode. */
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"))
die("Not a git repository");
if (*opt_encoding && strcasecmp(opt_encoding, "UTF-8"))