diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/reset.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/reset.c b/src/reset.c index e403e2a9a..248c91d3a 100644 --- a/src/reset.c +++ b/src/reset.c @@ -60,13 +60,18 @@ int git_reset_default( for (i = 0, max_i = git_diff_num_deltas(diff); i < max_i; ++i) { const git_diff_delta *delta = git_diff_get_delta(diff, i); - if ((error = git_index_conflict_remove(index, delta->old_file.path)) < 0) - goto cleanup; - assert(delta->status == GIT_DELTA_ADDED || delta->status == GIT_DELTA_MODIFIED || delta->status == GIT_DELTA_DELETED); + error = git_index_conflict_remove(index, delta->old_file.path); + if (error < 0) { + if (delta->status == GIT_DELTA_ADDED && error == GIT_ENOTFOUND) + giterr_clear(); + else + goto cleanup; + } + if (delta->status == GIT_DELTA_DELETED) { if ((error = git_index_remove(index, delta->old_file.path, 0)) < 0) goto cleanup; |