diff options
author | Denton Liu <liu.denton@gmail.com> | 2020-04-07 16:27:58 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-04-10 18:28:02 +0200 |
commit | 86ed00aff4b86eed6ecc606e9d5f7828a1dca353 (patch) | |
tree | 25ffee60f467f9e4b343f21e09b2f2db2795526c /sequencer.c | |
parent | sequencer: rename stash_sha1 to stash_oid (diff) | |
download | git-86ed00aff4b86eed6ecc606e9d5f7828a1dca353.tar.xz git-86ed00aff4b86eed6ecc606e9d5f7828a1dca353.zip |
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 <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c index 4a6812e90e..f5bb1cc1fb 100644 --- a/sequencer.c +++ b/sequencer.c @@ -3657,7 +3657,7 @@ static enum todo_command peek_command(struct todo_list *todo_list, int offset) return -1; } -static int apply_autostash(const char *path) +int apply_autostash(const char *path) { struct strbuf stash_oid = STRBUF_INIT; struct child_process child = CHILD_PROCESS_INIT; |