]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'pw/checkout-conflict-errorfix'
authorJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2024 20:21:33 +0000 (13:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Apr 2024 20:21:33 +0000 (13:21 -0700)
"git checkout --conflict=bad" reported a bad conflictStyle as if it
were given to a configuration variable; it has been corrected to
report that the command line option is bad.

* pw/checkout-conflict-errorfix:
  checkout: fix interaction between --conflict and --merge
  checkout: cleanup --conflict=<style> parsing
  merge options: add a conflict style member
  merge-ll: introduce LL_MERGE_OPTIONS_INIT
  xdiff-interface: refactor parsing of merge.conflictstyle

1  2 
builtin/checkout.c
merge-ll.c
merge-ort.c
merge-recursive.c

index 2e8b0d18f445b1307e264634f69c8ce0a3a5c68a,30d13c9e1482e18ecde12ff40810bedb277b432e..2b6166c284e0dda89b829c88313711d078bd2632
@@@ -1930,8 -1924,9 +1949,7 @@@ int cmd_checkout(int argc, const char *
                OPT_BOOL(0, "overlay", &opts.overlay_mode, N_("use overlay mode (default)")),
                OPT_END()
        };
 -      int ret;
 -      struct branch_info new_branch_info = { 0 };
  
-       memset(&opts, 0, sizeof(opts));
        opts.dwim_new_local_branch = 1;
        opts.switch_branch_doing_nothing_is_ok = 1;
        opts.only_merge_on_switching_branches = 0;
@@@ -1978,8 -1978,9 +1996,7 @@@ int cmd_switch(int argc, const char **a
                         N_("throw away local modifications")),
                OPT_END()
        };
 -      int ret;
 -      struct branch_info new_branch_info = { 0 };
  
-       memset(&opts, 0, sizeof(opts));
        opts.dwim_new_local_branch = 1;
        opts.accept_ref = 1;
        opts.accept_pathspec = 0;
@@@ -2016,8 -2020,9 +2033,7 @@@ int cmd_restore(int argc, const char **
                OPT_BOOL(0, "overlay", &opts.overlay_mode, N_("use overlay mode")),
                OPT_END()
        };
 -      int ret;
 -      struct branch_info new_branch_info = { 0 };
  
-       memset(&opts, 0, sizeof(opts));
        opts.accept_ref = 0;
        opts.accept_pathspec = 1;
        opts.empty_pathspec_ok = 0;
diff --cc merge-ll.c
Simple merge
diff --cc merge-ort.c
Simple merge
Simple merge