diff options
Diffstat (limited to 'add-interactive.c')
-rw-r--r-- | add-interactive.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/add-interactive.c b/add-interactive.c index 6498ae196f..7247210301 100644 --- a/add-interactive.c +++ b/add-interactive.c @@ -70,6 +70,8 @@ void init_add_i_state(struct add_i_state *s, struct repository *r) &s->interactive_diff_algorithm); git_config_get_bool("interactive.singlekey", &s->use_single_key); + if (s->use_single_key) + setbuf(stdin, NULL); } void clear_add_i_state(struct add_i_state *s) @@ -797,14 +799,14 @@ static int run_revert(struct add_i_state *s, const struct pathspec *ps, diffopt.flags.override_submodule_config = 1; diffopt.repo = s->r; - if (do_diff_cache(&oid, &diffopt)) + if (do_diff_cache(&oid, &diffopt)) { + diff_free(&diffopt); res = -1; - else { + } else { diffcore_std(&diffopt); diff_flush(&diffopt); } free(paths); - clear_pathspec(&diffopt.pathspec); if (!res && write_locked_index(s->r->index, &index_lock, COMMIT_LOCK) < 0) |