diff options
author | Jeff King <peff@peff.net> | 2014-05-06 23:00:37 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-05-07 10:40:01 -0700 |
commit | 26ecfe3e2041fe651c9682ebb73911777290ac62 (patch) | |
tree | 094257ada0bd8a4f3302ab374f2209ba1d09425c /prompt.h | |
parent | 0bc85abb7aa9b24b093253018801a0fb43d01122 (diff) | |
download | git-26ecfe3e2041fe651c9682ebb73911777290ac62.tar.gz |
grep: use run-command's "dir" option for --open-files-in-pagerjk/grep-tell-run-command-to-cd-when-running-pager
Git generally changes directory to the repository root on
startup. When running "grep --open-files-in-pager" from a
subdirectory, we chdir back to the original directory before
running the pager, so that we can feed the relative
pathnames to the pager.
We currently do this chdir manually, but we can ask
run_command to do it for us. This is fewer lines of code,
and as a bonus, the chdir is limited to the child process,
which avoids any unexpected surprises for code running after
the pager (there isn't any currently, but this is
future-proofing).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'prompt.h')
0 files changed, 0 insertions, 0 deletions