return freed_mem;
}
+static int report_delta_progress(git_packbuilder *pb, uint32_t count, bool force)
+{
+ int ret;
+
+ if (pb->progress_cb) {
+ double current_time = git__timer();
+ double elapsed = current_time - pb->last_progress_report_time;
+
+ if (force || elapsed >= MIN_PROGRESS_UPDATE_INTERVAL) {
+ pb->last_progress_report_time = current_time;
+
+ ret = pb->progress_cb(
+ GIT_PACKBUILDER_DELTAFICATION,
+ count, pb->nr_objects, pb->progress_cb_payload);
+
+ if (ret)
+ return giterr_set_after_callback(ret);
+ }
+ }
+
+ return 0;
+}
+
static int find_deltas(git_packbuilder *pb, git_pobject **list,
unsigned int *list_size, unsigned int window,
int depth)
break;
}
+ pb->nr_deltified += 1;
+ report_delta_progress(pb, pb->nr_deltified, false);
+
po = *list++;
(*list_size)--;
git_packbuilder__progress_unlock(pb);
}
}
+ report_delta_progress(pb, pb->nr_objects, true);
+
pb->done = true;
git__free(delta_list);
return 0;