commit - cdbfe5d2325bd7ae7a197ce5e7a93fcdba9097cb
commit + f6b8c3c2253c61e60153121cfa4da7c350787598
blob - 92a65f77687232bb4d27acbaae8e54b80258a589
blob + d4aed4f6bf14dbd91a5d5efb9d4479dcd6164ec4
--- lib/worktree.c
+++ lib/worktree.c
diff_old_new(void *arg, struct got_fileindex_entry *ie,
struct got_tree_entry *te, const char *parent_path)
{
+ const struct got_error *err = NULL;
struct diff_cb_arg *a = arg;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
return update_blob(a->worktree, a->fileindex, ie, te,
ie->path, a->repo, a->progress_cb, a->progress_arg);
static const struct got_error *
diff_old(void *arg, struct got_fileindex_entry *ie, const char *parent_path)
{
+ const struct got_error *err = NULL;
struct diff_cb_arg *a = arg;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
return delete_blob(a->worktree, a->fileindex, ie,
a->repo, a->progress_cb, a->progress_arg);
static const struct got_error *
diff_new(void *arg, struct got_tree_entry *te, const char *parent_path)
{
+ const struct got_error *err = NULL;
struct diff_cb_arg *a = arg;
- const struct got_error *err;
char *path;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (got_object_tree_entry_is_submodule(te))
return NULL;
static const struct got_error *
check_mixed_commits(void *arg, struct got_fileindex_entry *ie)
{
- const struct got_error *err;
+ const struct got_error *err = NULL;
struct check_mixed_commits_args *a = arg;
if (a->cancel_cb) {
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 (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (got_path_cmp(parent_path, a->status_path,
strlen(parent_path), a->status_path_len) != 0 &&
static const struct got_error *
status_old(void *arg, struct got_fileindex_entry *ie, const char *parent_path)
{
+ const struct got_error *err;
struct diff_dir_cb_arg *a = arg;
struct got_object_id blob_id, commit_id;
unsigned char status;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (!got_path_is_child(ie->path, a->status_path, a->status_path_len))
return NULL;
if (ignore != NULL)
*ignore = 0;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (parent_path[0]) {
if (asprintf(&path, "%s/%s", parent_path, de->d_name) == -1)
static const struct got_error *
report_file_info(void *arg, struct got_fileindex_entry *ie)
{
+ const struct got_error *err;
struct report_file_info_arg *a = arg;
struct got_pathlist_entry *pe;
struct got_object_id blob_id, staged_blob_id, commit_id;
struct got_object_id *commit_idp = NULL;
int stage;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
TAILQ_FOREACH(pe, a->paths, entry) {
if (pe->path_len == 0 || strcmp(pe->path, ie->path) == 0 ||
blob - 60d6d90c718edb4cbd775eb19fd4aaa26b0e8f65
blob + f488cd9dcd98b68c647973cb84a54e18daefced4
--- lib/worktree_cvg.c
+++ lib/worktree_cvg.c
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 (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (got_path_cmp(parent_path, a->status_path,
strlen(parent_path), a->status_path_len) != 0 &&
static const struct got_error *
status_old(void *arg, struct got_fileindex_entry *ie, const char *parent_path)
{
+ const struct got_error *err = NULL;
struct diff_dir_cb_arg *a = arg;
struct got_object_id blob_id, commit_id;
unsigned char status;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (!got_path_is_child(ie->path, a->status_path, a->status_path_len))
return NULL;
if (ignore != NULL)
*ignore = 0;
- if (a->cancel_cb && a->cancel_cb(a->cancel_arg))
- return got_error(GOT_ERR_CANCELLED);
+ if (a->cancel_cb) {
+ err = a->cancel_cb(a->cancel_arg);
+ if (err)
+ return err;
+ }
if (parent_path[0]) {
if (asprintf(&path, "%s/%s", parent_path, de->d_name) == -1)