commit - 6ebb22635171b6f1ad080fe10bf7b13133312957
commit + eb6fb9cdfb8f52fcb6baf65ca864b8e506f64901
blob - f030f406e8a794cac4ca4f732883444b6383330e
blob + 0b8df90d6178c4aba29b97a3104bc1795fe9bf1e
--- 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 - 7474e1e56256feab89546eaea263ef6d37b7a7ab
blob + 7f15e7a9110a620784dda702c084efc32970a6bd
--- 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)