From: Jeff King Date: Wed, 15 Mar 2017 20:06:53 +0000 (-0400) Subject: rev-parse: add helper for parsing "--foo/--foo=" X-Git-Tag: v2.12.3~13^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9d16ca65bbe45d4a28cbb37c3299b544c81ff2e8?ds=inline;hp=9d16ca65bbe45d4a28cbb37c3299b544c81ff2e8 rev-parse: add helper for parsing "--foo/--foo=" We can't just use a bare skip_prefix() for these cases, because we need to match both the "--foo" form and the "--foo=" form (and tell the difference between the two in the caller). We can wrap this in a simple helper which has two obvious callsites, and will gain some more in the next patch. Note that the error output for abbrev-ref changes slightly, as we don't keep our original "arg" pointer. However, the new output should hopefully be more clear: [before] fatal: unknown mode for --abbrev-ref=foo [after] fatal: unknown mode for --abbrev-ref: foo Signed-off-by: Jeff King Signed-off-by: Junio C Hamano ---