merge-ort: have process_entries operate in a defined order
authorElijah Newren <newren@gmail.com>
Sun, 13 Dec 2020 08:04:19 +0000 (08:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 Dec 2020 22:18:20 +0000 (14:18 -0800)
commit8adffaa818d17595b23959e995ad395c8cd0b0be
tree697359a0a10e85444a60a0efb589707dae54b3e2
parent6a02dd90c99c59eada5e5b80e7140e56c1d4a2b0
merge-ort: have process_entries operate in a defined order

We want to handle paths below a directory before needing to handle the
directory itself.  Also, we want to handle the directory immediately
after the paths below it, so we can't use simple lexicographic ordering
from strcmp (which would insert foo.txt between foo and foo/file.c).
Copy string_list_df_name_compare() from merge-recursive.c, and set up a
string list of paths sorted by that function so that we can iterate in
the desired order.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-ort.c