Re: [PATCH/RFC] rewrite `git_default_config()` using config-set API functions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 21, 2014, 18:07 UTC
- Message-ID
- <xmqqa982k2lm.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <vpqzjg2204x.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> In general, most strings one manipulates are "const char *", it's > frequent to modify a pointer to a string, but rather rare to modify the > string itself.
We seem to have a disagreement. Unlike git_config_get_value() that lets callers peek the only cached copy, git_config_get_string() gives its caller a new copy that the caller needs to free. Such a new string can and should be given as mutable, I would say.