commit - b7011c591b3ddd2fc487615e4106ab29a93e1b84
commit + 0584f85431b3c981d2bf612657aa3931ff4d42e6
blob - 1c52dfccc40e6d19f1b6253bbb99f967a6947b67
blob + 92720c552b8f12476bbc668ea2e70a5bb52cda8e
--- lib/worktree.c
+++ lib/worktree.c
struct got_fileindex *fileindex, struct got_fileindex_entry *ie,
struct got_tree_entry *te, const char *path,
struct got_repository *repo, got_worktree_checkout_cb progress_cb,
- void *progress_arg, got_worktree_cancel_cb cancel_cb, void *cancel_arg)
+ void *progress_arg)
{
const struct got_error *err = NULL;
struct got_blob_object *blob = NULL;
delete_blob(struct got_worktree *worktree, struct got_fileindex *fileindex,
struct got_fileindex_entry *ie, const char *parent_path,
struct got_repository *repo,
- got_worktree_checkout_cb progress_cb, void *progress_arg,
- got_worktree_cancel_cb cancel_cb, void *cancel_arg)
+ got_worktree_checkout_cb progress_cb, void *progress_arg)
{
const struct got_error *err = NULL;
unsigned char status;
struct got_tree_entry *te, const char *parent_path)
{
struct diff_cb_arg *a = arg;
+
+ if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
+ return got_error(GOT_ERR_CANCELLED);
return update_blob(a->worktree, a->fileindex, ie, te,
- ie->path, a->repo, a->progress_cb, a->progress_arg,
- a->cancel_cb, a->cancel_arg);
+ ie->path, a->repo, a->progress_cb, a->progress_arg);
}
static const struct got_error *
{
struct diff_cb_arg *a = arg;
+ if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
+ return got_error(GOT_ERR_CANCELLED);
+
return delete_blob(a->worktree, a->fileindex, ie, parent_path,
- a->repo, a->progress_cb, a->progress_arg,
- a->cancel_cb, a->cancel_arg);
+ a->repo, a->progress_cb, a->progress_arg);
}
static const struct got_error *
const struct got_error *err;
char *path;
+ if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
+ return got_error(GOT_ERR_CANCELLED);
+
if (asprintf(&path, "%s%s%s", parent_path,
parent_path[0] ? "/" : "", te->name)
== -1)
err = add_dir_on_disk(a->worktree, path);
else
err = update_blob(a->worktree, a->fileindex, NULL, te, path,
- a->repo, a->progress_cb, a->progress_arg,
- a->cancel_cb, a->cancel_arg);
+ a->repo, a->progress_cb, a->progress_arg);
free(path);
return err;
struct diff_dir_cb_arg *a = arg;
char *abspath;
+ if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
+ return got_error(GOT_ERR_CANCELLED);
+
if (got_path_cmp(parent_path, a->status_path) != 0 &&
!got_path_is_child(parent_path, a->status_path, a->status_path_len))
return NULL;
struct got_object_id id;
unsigned char status;
+ if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
+ return got_error(GOT_ERR_CANCELLED);
+
if (!got_path_is_child(parent_path, a->status_path, a->status_path_len))
return NULL;
struct diff_dir_cb_arg *a = arg;
char *path = NULL;
+ if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
+ return got_error(GOT_ERR_CANCELLED);
+
if (de->d_type == DT_DIR)
return NULL;