summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorMartin Ågren <martin.agren@gmail.com>2019-02-04 20:50:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-04 21:12:37 (GMT)
commit2afe9278a2c1930538ea465955174abf82def3e5 (patch)
treef5ceb744374fdabb93faf8bdf70479b4d5810061 /fetch-pack.c
parentad51743007d408ba6f1f670126d57722bb397ce6 (diff)
downloadgit-2afe9278a2c1930538ea465955174abf82def3e5.zip
git-2afe9278a2c1930538ea465955174abf82def3e5.tar.gz
git-2afe9278a2c1930538ea465955174abf82def3e5.tar.bz2
doc-diff: don't `cd_to_toplevel`
`usage` tries to call $0, which might very well be "./doc-diff", so if we `cd_to_toplevel` before calling `usage`, we'll end with an error to the effect of "./doc-diff: not found" rather than a friendly `doc-diff -h` output. This regressed in ad51743007 ("doc-diff: add --clean mode to remove temporary working gunk", 2018-08-31) where we moved the call to `cd_to_toplevel` to much earlier. A general fix might be to teach git-sh-setup to save away the absolute path for $0 and then use that, instead. I'm not aware of any portable way of doing that, see, e.g., d2addc3b96 ("t7800: readlink may not be available", 2016-05-31). An early version of this patch moved `cd_to_toplevel` back to where it was before ad51743007 and taught the "--clean" code to cd on its own. But let's try instead to get rid of the cd-ing entirely. We don't really need it and we can work with absolute paths instead. There's just one use of $PWD that we need to adjust by simply dropping it. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Martin Ågren <martin.agren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fetch-pack.c')
0 files changed, 0 insertions, 0 deletions