Commit Diff


commit - ca355955e0f94f5a3ad63c0b2a7adaf66e4a0b5b
commit + 55bd499d8ff69fab8462d256adae072aa762727f
blob - 3874728508ccfa6addbcb2e66197f10f8ba55d68
blob + cf788412d7d82a9e76021c6f880b299fe5b307f2
--- lib/worktree.c
+++ lib/worktree.c
@@ -3994,10 +3994,6 @@ got_worktree_rebase_abort(struct got_worktree *worktre
 	err = lock_worktree(worktree, LOCK_EX);
 	if (err)
 		return err;
-
-	err = open_fileindex(&fileindex, &fileindex_path, worktree);
-	if (err)
-		goto done;
 
 	err = got_ref_open(&resolved, repo,
 	    got_ref_get_symref_target(new_base_branch), 0);
@@ -4037,6 +4033,10 @@ got_worktree_rebase_abort(struct got_worktree *worktre
 	if (err)
 		goto done;
 
+	err = open_fileindex(&fileindex, &fileindex_path, worktree);
+	if (err)
+		goto done;
+
 	TAILQ_FOREACH(pe, &revertible_paths, entry) {
 		err = revert_file(worktree, fileindex, pe->path,
 		    progress_cb, progress_arg, repo);