diff options
| author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2024-03-14 17:05:06 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-03-14 10:08:53 -0700 |
| commit | dbeaf8e8c0ada5ba6a8c379e2ad7bab7e815ba79 (patch) | |
| tree | 745aa54b762f090041e445896e7410d66506af38 /t/unit-tests/t-mem-pool.c | |
| parent | 135cc712c39fa7ccf25b9b2b55d1d07fc85c85a4 (diff) | |
checkout: cleanup --conflict=<style> parsing
Passing an invalid conflict style name such as "--conflict=bad" gives
the error message
error: unknown style 'bad' given for 'merge.conflictstyle'
which is unfortunate as it talks about a config setting rather than
the option given on the command line. This happens because the
implementation calls git_xmerge_config() to set the conflict style
using the value given on the command line. Use the newly added
parse_conflict_style_name() instead and pass the value down the call
chain to override the config setting. This also means we can avoid
setting up a struct config_context required for calling
git_xmerge_config().
The option is now parsed in a callback to avoid having to store the
option name. This is a change in behavior as now
git checkout --conflict=bad --conflict=diff3
will error out when parsing "--conflict=bad" whereas before this change
it would succeed because it would only try to parse the value of the
last "--conflict" option given on the command line.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-mem-pool.c')
0 files changed, 0 insertions, 0 deletions
