]> git.ipfire.org Git - thirdparty/git.git/commit
rev-parse: simplify dotdot parsing
authorJeff King <peff@peff.net>
Thu, 26 Mar 2026 19:05:25 +0000 (15:05 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 Mar 2026 19:47:17 +0000 (12:47 -0700)
commit268a9caaf29f0269147dacbea2c8d439c505c5ee
tree80004a85bd65bdce97f9d03fb2b06223824e0981
parent4d5fb9377bba1f45a940e10b0b7354fe7db2b301
rev-parse: simplify dotdot parsing

The previous commit simplified the way that revision.c parses ".." and
"..." range operators. But there's roughly similar code in rev-parse.
This is less likely to trigger a segfault, as there is no library
function which we'd pass a string literal to, but it still causes the
compiler to complain about laundering away constness via strstr().

Let's give it the same treatment, copying the left-hand side of the
range operator into its own string.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rev-parse.c