summaryrefslogtreecommitdiff
path: root/sequencer.h
diff options
context:
space:
mode:
authorAlban Gruin <alban.gruin@gmail.com>2019-03-05 19:17:55 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-03-07 00:17:57 (GMT)
commitf2a04904be6584f1ec783ed5d3c425026bcf908f (patch)
treed748ccafea452c7085dd686d1d3a8da0f5341c1c /sequencer.h
parent683153a438f1b6b8e1a289a71f36244bde67e38f (diff)
downloadgit-f2a04904be6584f1ec783ed5d3c425026bcf908f.zip
git-f2a04904be6584f1ec783ed5d3c425026bcf908f.tar.gz
git-f2a04904be6584f1ec783ed5d3c425026bcf908f.tar.bz2
sequencer: refactor rearrange_squash() to work on a todo_list
This refactors rearrange_squash() to work on a todo_list to avoid redundant reads and writes. The function is renamed todo_list_rearrange_squash(). The old version created a new buffer, which was directly written to the disk. This new version creates a new item list by just copying items from the old item list, without creating a new buffer. This eliminates the need to reparse the todo list, but this also means its buffer cannot be directly written to the disk. As rebase -p still need to check the todo list from the disk, a new function is introduced, rearrange_squash_in_todo_file(). complete_action() still uses rearrange_squash_in_todo_file() 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 'sequencer.h')
-rw-r--r--sequencer.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.h b/sequencer.h
index 87d04a3..add50f0 100644
--- a/sequencer.h
+++ b/sequencer.h
@@ -154,7 +154,7 @@ int complete_action(struct repository *r, struct replay_opts *opts, unsigned fla
const char *shortrevisions, const char *onto_name,
const char *onto, const char *orig_head, struct string_list *commands,
unsigned autosquash);
-int rearrange_squash(struct repository *r);
+int rearrange_squash_in_todo_file(struct repository *r);
extern const char sign_off_header[];