]> git.ipfire.org Git - thirdparty/git.git/commit
sequencer: simplify away extra git_config_string() call
authorJeff King <peff@peff.net>
Thu, 7 Dec 2023 07:26:42 +0000 (02:26 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 8 Dec 2023 23:26:23 +0000 (08:26 +0900)
commitea8f9494aba052fd531f674f78dba55f084bdc34
treed16474de4654224610d88c92db653833c8119bb5
parent004c9432f7e4c9f1f3b915b0785d0f175dc664fe
sequencer: simplify away extra git_config_string() call

In our config callback, we call git_config_string() to copy the incoming
value string into a local string. But we don't modify or store that
string; we just look at it and then free it. We can make the code
simpler by just looking at the value passed into the callback.

Note that we do need to check for NULL, which is the one bit of logic
git_config_string() did for us. And I could even see an argument that we
are abstracting any error-checking of the value behind the
git_config_string() layer. But in practice no other callbacks behave
this way; it is standard to check for NULL and then just look at the
string directly.

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