summaryrefslogtreecommitdiff
path: root/builtin/ls-files.c
diff options
context:
space:
mode:
authorLibravatar Alban Gruin <alban.gruin@gmail.com>2019-03-05 20:17:54 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-03-07 09:17:57 +0900
commit683153a438f1b6b8e1a289a71f36244bde67e38f (patch)
treecafa8f2d8cf438d11052caf8071c7b23523ca67e /builtin/ls-files.c
parentsequencer: refactor check_todo_list() to work on a todo_list (diff)
downloadtgif-683153a438f1b6b8e1a289a71f36244bde67e38f.tar.xz
sequencer: refactor sequencer_add_exec_commands() to work on a todo_list
This refactors sequencer_add_exec_commands() to work on a todo_list to avoid redundant reads and writes to the disk. Instead of inserting the `exec' commands between the other commands and re-parsing the buffer at the end, they are appended to the buffer once, and a new list of items is created. Items from the old list are copied across and new `exec' items are appended when necessary. This eliminates the need to reparse the buffer, but this also means we have to use todo_list_write_to_disk() to write the file. todo_list_add_exec_commands() and sequencer_add_exec_commands() are modified to take a string list instead of a string -- one item for each command. This makes it easier to insert a new command to the todo list for each command to execute. sequencer_add_exec_commands() still reads the todo list from the disk, as it is needed by rebase -p. complete_action() still uses sequencer_add_exec_commands() for now. This will be changed in a future commit. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-files.c')
0 files changed, 0 insertions, 0 deletions