[PATCH v7 02/9] Stop starting pager recursively
- From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
- Date
- Mar 13, 2012, 12:09 UTC
- Message-ID
- <dd6e9c2189fb4502aaf9f7368cb7f13216961cfa.1331638663.git.pclouds@gmail.com>
- In-Reply-To
- <1294ed94f981a7029b47a44143c3eb9fb6b820f1.1331638663.git.pclouds@gmail.com>
git-column can be used as a pager for other git commands, something like this:
GIT_PAGER="git -p column --mode='dense color'" git -p branch
The problem with this is that "git -p column" also has $GIT_PAGER set so the pager runs itself again as another pager. The end result is an infinite loop of forking. Other git commands have the same problem if being abused this way.
Check if $GIT_PAGER is already set and stop launching another pager.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> --- pager.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pager.c b/pager.c index 05584de..4dcb08d 100644 --- a/pager.c +++ b/pager.c @@ -73,7 +73,7 @@ void setup_pager(void) { const char *pager = git_pager(isatty(1)); - if (!pager) + if (!pager || pager_in_use()) return; /*
-- 1.7.8.36.g69ee2