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>
Pratik Karki committed
Aug 8, 2018 at 20:51 UTC
0eabf4b95ca2d3213194de95cc9cd62593811965
1 file changed
+5
builtin/rebase.c
+5
@@ -539,6 +539,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
539
540
git_config(rebase_config, &options);
541
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
+
547
if (is_directory(apply_dir())) {
548
options.type = REBASE_AM;
549
options.state_dir = apply_dir();