make stage worktree API look more like the one for 'add'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
diff --git a/include/got_worktree.h b/include/got_worktree.h
index c985f53..2d55ba4 100644
--- a/include/got_worktree.h
+++ b/include/got_worktree.h
@@ -379,7 +379,6 @@ const struct got_error *got_worktree_get_histedit_script_path(char **,
* pointer is expected to point at a const char * path of a file which
* contains alternative content to be staged instead.
*/
-const struct got_error *got_worktree_stage_paths(struct got_worktree *,
- struct got_pathlist_head *, struct got_repository *,
- got_worktree_status_cb, void *,
- got_worktree_cancel_cb , void *);
+const struct got_error *got_worktree_stage(struct got_worktree *,
+ struct got_pathlist_head *, got_worktree_status_cb, void *,
+ struct got_repository *);
diff --git a/lib/worktree.c b/lib/worktree.c
index a88831b..969b659 100644
--- a/lib/worktree.c
+++ b/lib/worktree.c
@@ -4917,10 +4917,10 @@ done:
}
const struct got_error *
-got_worktree_stage_paths(struct got_worktree *worktree,
- struct got_pathlist_head *paths, struct got_repository *repo,
+got_worktree_stage(struct got_worktree *worktree,
+ struct got_pathlist_head *paths,
got_worktree_status_cb status_cb, void *status_arg,
- got_worktree_cancel_cb cancel_cb, void *cancel_arg)
+ struct got_repository *repo)
{
const struct got_error *err = NULL, *sync_err, *unlockerr;
struct got_pathlist_entry *pe;
@@ -4936,11 +4936,6 @@ got_worktree_stage_paths(struct got_worktree *worktree,
goto done;
TAILQ_FOREACH(pe, paths, entry) {
- if (cancel_cb) {
- err = (*cancel_cb)(cancel_arg);
- if (err)
- break;
- }
err = stage_path(pe->path, pe->path_len, (const char *)pe->data,
worktree, fileindex, repo, status_cb, status_arg);
if (err)