From 86ed00aff4b86eed6ecc606e9d5f7828a1dca353 Mon Sep 17 00:00:00 2001 From: Denton Liu Date: Tue, 7 Apr 2020 10:27:58 -0400 Subject: rebase: use apply_autostash() from sequencer.c The apply_autostash() function in builtin/rebase.c is similar enough to the apply_autostash() function in sequencer.c that they are almost interchangeable, except for the type of arg they accept. Make the sequencer.c version extern and use it in rebase. The rebase version was introduced in 6defce2b02 (builtin rebase: support `--autostash` option, 2018-09-04) as part of the shell to C conversion. It opted to duplicate the function because, at the time, there was another in-progress project converting interactive rebase from shell to C as well and they did not want to clash with them by refactoring sequencer.c version of apply_autostash(). Since both efforts are long done, we can freely combine them together now. Signed-off-by: Denton Liu Signed-off-by: Junio C Hamano --- sequencer.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sequencer.h') diff --git a/sequencer.h b/sequencer.h index ab43717fd6..ab686146d1 100644 --- a/sequencer.h +++ b/sequencer.h @@ -191,6 +191,8 @@ void commit_post_rewrite(struct repository *r, const struct commit *current_head, const struct object_id *new_head); +int apply_autostash(const char *path); + #define SUMMARY_INITIAL_COMMIT (1 << 0) #define SUMMARY_SHOW_AUTHOR_DATE (1 << 1) void print_commit_summary(struct repository *repo, -- cgit v1.2.3