From be6bc048d74779476610caa7bfb51ef0b71ba5a6 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 7 Dec 2023 02:26:11 -0500 Subject: config: use git_config_string() for core.checkRoundTripEncoding Since this code path was recently converted to check for a NULL value, it now behaves exactly like git_config_string(). We can shorten the code a bit by using that helper. Note that git_config_string() takes a const pointer, but our storage variable is non-const. We're better off making this "const", though, since the default value points to a string literal (and thus it would be an error if anybody tried to write to it). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- environment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'environment.c') diff --git a/environment.c b/environment.c index 9e37bf58c0..90632a39bc 100644 --- a/environment.c +++ b/environment.c @@ -64,7 +64,7 @@ const char *excludes_file; enum auto_crlf auto_crlf = AUTO_CRLF_FALSE; enum eol core_eol = EOL_UNSET; int global_conv_flags_eol = CONV_EOL_RNDTRP_WARN; -char *check_roundtrip_encoding = "SHIFT-JIS"; +const char *check_roundtrip_encoding = "SHIFT-JIS"; enum branch_track git_branch_track = BRANCH_TRACK_REMOTE; enum rebase_setup_type autorebase = AUTOREBASE_NEVER; enum push_default_type push_default = PUSH_DEFAULT_UNSPECIFIED; -- cgit v1.2.3