commit ca355955e0f94f5a3ad63c0b2a7adaf66e4a0b5b from: Stefan Sperling date: Fri Jul 12 12:51:33 2019 UTC oops, sync fileindex again after aborting rebase commit - 267fb25597ba2b8c0e90ce0e454239657b189135 commit + ca355955e0f94f5a3ad63c0b2a7adaf66e4a0b5b blob - 8a0bcac6de0a418b0a7d71ed95c40e4e6c67778c blob + 3874728508ccfa6addbcb2e66197f10f8ba55d68 --- lib/worktree.c +++ lib/worktree.c @@ -3979,7 +3979,7 @@ got_worktree_rebase_abort(struct got_worktree *worktre struct got_repository *repo, struct got_reference *new_base_branch, got_worktree_checkout_cb progress_cb, void *progress_arg) { - const struct got_error *err, *unlockerr; + const struct got_error *err, *unlockerr, *sync_err; struct got_reference *resolved = NULL; struct got_object_id *commit_id = NULL; struct got_fileindex *fileindex = NULL; @@ -4021,6 +4021,15 @@ got_worktree_rebase_abort(struct got_worktree *worktre if (err) goto done; + err = got_object_id_by_path(&tree_id, repo, + worktree->base_commit_id, worktree->path_prefix); + if (err) + goto done; + + err = delete_rebase_refs(worktree, repo); + if (err) + goto done; + crp_arg.revertible_paths = &revertible_paths; crp_arg.worktree = worktree; err = got_worktree_status(worktree, "", repo, @@ -4032,19 +4041,15 @@ got_worktree_rebase_abort(struct got_worktree *worktre err = revert_file(worktree, fileindex, pe->path, progress_cb, progress_arg, repo); if (err) - goto done; + goto sync; } - err = got_object_id_by_path(&tree_id, repo, - worktree->base_commit_id, worktree->path_prefix); - if (err) - goto done; err = checkout_files(worktree, fileindex, "", tree_id, NULL, repo, progress_cb, progress_arg, NULL, NULL); - if (err) - goto done; - - err = delete_rebase_refs(worktree, repo); +sync: + sync_err = sync_fileindex(fileindex, fileindex_path); + if (sync_err && err == NULL) + err = sync_err; done: got_ref_close(resolved); free(tree_id);