• M
    merge: clarify call chain · 62dc42b9
    Michael J Gruber 提交于
    prepare_to_commit() cannot be reached in the non-squash case:
    It is called by merge_trivial() and finish_automerge() only, but the
    calls to the latter are somewhat hard to track:
    
    If option_commit is not set, the code in cmd_merge() uses a fake
    conflict return code (ret=1) to avoid writing the tree, which also
    avoids setting automerge_was_ok (just as in the proper ret==1 case), so
    that finish_automerge() is not called.
    
    To ensure that no code change breaks that assumption, safe-guard
    prepare_to_commit() by a BUG() statement.
    Suggested-by: NJunio C Hamano <gitster@pobox.com>
    Signed-off-by: NMichael J Gruber <git@grubix.eu>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    62dc42b9
merge.c 42.3 KB