Skip to content

Commit e01f72b

Browse files
prertikgitster
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 <predatoramigo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent fe76836 commit e01f72b

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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)