Skip to content

Commit 582d406

Browse files
prertikdscho
authored andcommitted
builtin rebase: stop if git am is in progress
This commit checks for the file `applying` used by `git am` in `rebase-apply/` and if the file is present it means `git am` is in progress so it errors out. Signed-off-by: Pratik Karki <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d90f8a8 commit 582d406

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builtin/rebase.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
539539

540540
git_config(rebase_config, &options);
541541

542+
strbuf_reset(&buf);
543+
strbuf_addf(&buf, "%s/applying", apply_dir());
544+
if(file_exists(buf.buf))
545+
die(_("It looks like 'git am' is in progress. Cannot rebase."));
546+
542547
if (is_directory(apply_dir())) {
543548
options.type = REBASE_AM;
544549
options.state_dir = apply_dir();

0 commit comments

Comments
 (0)