From 3e3a4a41b0dac564c0302ced4ccc423d0d39bc21 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Tue, 16 Feb 2016 14:34:44 -0800 Subject: pager: factor out a helper to prepare a child process to run the pager When running a pager, we need to run the program git_pager() gave us, but we need to make sure we spawn it via the shell (i.e. it is valid to say PAGER='less -S', for example) and give default values to $LESS and $LV environment variables. Factor out these details to a separate helper function. Signed-off-by: Junio C Hamano --- cache.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 6bb7119032..a839accbd6 100644 --- a/cache.h +++ b/cache.h @@ -210,7 +210,9 @@ struct cache_entry { #error "CE_EXTENDED_FLAGS out of range" #endif +/* Forward structure decls */ struct pathspec; +struct child_process; /* * Copy the sha1 and stat state of a cache entry from one to @@ -1550,6 +1552,7 @@ extern int pager_use_color; extern int term_columns(void); extern int decimal_width(uintmax_t); extern int check_pager_config(const char *cmd); +extern void prepare_pager_args(struct child_process *, const char *pager); extern const char *editor_program; extern const char *askpass_program; -- cgit v1.2.1