Commit Diff


commit - 711d9cd95d584b2dade8466499cbce1984cee332
commit + a3a2faf2675b16ab805c74a24d7211f59c837316
blob - fef9f1c9f98f9508da4e9482e01d7842377b42bf
blob + 84afda62f5a53e15c091e9bda641c9d9148cc2ab
--- lib/worktree.c
+++ lib/worktree.c
@@ -3987,6 +3987,7 @@ got_worktree_rebase_abort(struct got_worktree *worktre
 	struct got_pathlist_head revertible_paths;
 	struct got_pathlist_entry *pe;
 	struct collect_revertible_paths_arg crp_arg;
+	struct got_object_id *tree_id = NULL;
 
 	TAILQ_INIT(&revertible_paths);
 
@@ -4020,8 +4021,12 @@ got_worktree_rebase_abort(struct got_worktree *worktre
 	if (err)
 		goto done;
 
-	err = got_worktree_checkout_files(worktree, "", repo, progress_cb,
-	    progress_arg, NULL, NULL);
+	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;
 
@@ -4042,6 +4047,7 @@ got_worktree_rebase_abort(struct got_worktree *worktre
 	err = delete_rebase_refs(worktree, repo);
 done:
 	got_ref_close(resolved);
+	free(tree_id);
 	free(commit_id);
 	if (fileindex)
 		got_fileindex_free(fileindex);