]> git.ipfire.org Git - thirdparty/git.git/commit - sequencer.c
sequencer: use reverse_commit_list() helper
authorJayati Shrivastava <gaurijove@gmail.com>
Wed, 16 Mar 2022 11:20:23 +0000 (11:20 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 16 Mar 2022 15:39:16 +0000 (08:39 -0700)
commit5327d8982a467c0043d2900d2afcfc21ef14820e
tree89d341968461b0aee96e0b80956de1bbe0768ed0
parent4c53a8c20f8984adb226293a3ffd7b88c3f4ac1a
sequencer: use reverse_commit_list() helper

Instead of creating a new allocation, reverse the original list
in-place by calling the reverse_commit_list() helper.

The original code discards the list "bases" after storing its
reverse copy in a newly created list "reversed".  If the code that
followed from here used both "bases" and "reversed", the
modification would not have worked, but since the original list
"bases" gets discarded, we can simply reverse "bases" in-place with
the reverse_commit_list() helper and reuse the same variable in the
code that follows.

builtin/merge.c has been left unmodified, since in its case, the
original list is needed separately from its reverse copy by the
code.

Signed-off-by: Jayati Shrivastava <gaurijove@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c