Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sequencer: return errors from sequencer_remove_state()
author
Phillip Wood
<phillip.wood@dunelm.org.uk>
Tue, 14 May 2019 18:03:48 +0000
(19:03 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 15 May 2019 01:59:33 +0000
(10:59 +0900)
If there is an error when removing the state directory then we should
report it. This matches what the non-interactive rebase does.
Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sequencer.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d3fce47
)
diff --git
a/sequencer.c
b/sequencer.c
index 610b7ece140bf1fa72c2ab66b5cb139fba102db4..258e5831565cb0782344eeffd2aa71eb161317df 100644
(file)
--- a/
sequencer.c
+++ b/
sequencer.c
@@
-274,7
+274,7
@@
static const char *gpg_sign_opt_quoted(struct replay_opts *opts)
int sequencer_remove_state(struct replay_opts *opts)
{
struct strbuf buf = STRBUF_INIT;
int sequencer_remove_state(struct replay_opts *opts)
{
struct strbuf buf = STRBUF_INIT;
- int i;
+ int i
, ret = 0
;
if (is_rebase_i(opts) &&
strbuf_read_file(&buf, rebase_path_refs_to_delete(), 0) > 0) {
if (is_rebase_i(opts) &&
strbuf_read_file(&buf, rebase_path_refs_to_delete(), 0) > 0) {
@@
-283,8
+283,10
@@
int sequencer_remove_state(struct replay_opts *opts)
char *eol = strchr(p, '\n');
if (eol)
*eol = '\0';
char *eol = strchr(p, '\n');
if (eol)
*eol = '\0';
- if (delete_ref("(rebase -i) cleanup", p, NULL, 0) < 0)
+ if (delete_ref("(rebase -i) cleanup", p, NULL, 0) < 0)
{
warning(_("could not delete '%s'"), p);
warning(_("could not delete '%s'"), p);
+ ret = -1;
+ }
if (!eol)
break;
p = eol + 1;
if (!eol)
break;
p = eol + 1;
@@
-300,10
+302,11
@@
int sequencer_remove_state(struct replay_opts *opts)
strbuf_reset(&buf);
strbuf_addstr(&buf, get_dir(opts));
strbuf_reset(&buf);
strbuf_addstr(&buf, get_dir(opts));
- remove_dir_recursively(&buf, 0);
+ if (remove_dir_recursively(&buf, 0))
+ ret = error(_("could not remove '%s'"), buf.buf);
strbuf_release(&buf);
strbuf_release(&buf);
- return
0
;
+ return
ret
;
}
static const char *action_name(const struct replay_opts *opts)
}
static const char *action_name(const struct replay_opts *opts)