diff options
author | Vasil Dimov <vd@FreeBSD.org> | 2020-04-15 20:32:24 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-15 18:32:47 -0700 |
commit | 8cf51561d1e15e8f5ad907df00884a7596737dcd (patch) | |
tree | 6ea3d2a9cc78824f5ed69c8dece47ad2de9728a0 /git-merge-octopus.sh | |
parent | Git 2.26.1 (diff) | |
download | tgif-8cf51561d1e15e8f5ad907df00884a7596737dcd.tar.xz |
range-diff: fix a crash in parsing git-log output
`git range-diff` calls `git log` internally and tries to parse its
output. But `git log` output can be customized by the user in their
git config and for certain configurations either an error will be
returned by `git range-diff` or it will crash.
To fix this explicitly set the output format of the internally
executed `git log` with `--pretty=medium`. Because that cancels
`--notes`, add explicitly `--notes` at the end.
Also, make sure we never crash in the same way - trying to dereference
`util` which was never created and has remained NULL. It would happen
if the first line of `git log` output does not begin with 'commit '.
Alternative considered but discarded - somehow disable all git configs
and behave as if no config is present in the internally executed
`git log`, but that does not seem to be possible. GIT_CONFIG_NOSYSTEM
is the closest to it, but even with that we would still read
`.git/config`.
Signed-off-by: Vasil Dimov <vd@FreeBSD.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-merge-octopus.sh')
0 files changed, 0 insertions, 0 deletions