Ejemplo n.º 1
0
static int do_progress_callback(git_indexer *idx, git_transfer_progress *stats)
{
	if (idx->progress_cb)
		return giterr_set_after_callback_function(
			idx->progress_cb(stats, idx->progress_payload),
			"indexer progress");
	return 0;
}
Ejemplo n.º 2
0
static int foreach_object_dir_cb(void *_state, git_buf *path)
{
	git_oid oid;
	struct foreach_state *state = (struct foreach_state *) _state;

	if (filename_to_oid(&oid, path->ptr + state->dir_len) < 0)
		return 0;

	return giterr_set_after_callback_function(
		state->cb(&oid, state->data), "git_odb_foreach");
}
Ejemplo n.º 3
0
static int tags_cb(const char *ref, void *data)
{
    int error;
    git_oid oid;
    tag_cb_data *d = (tag_cb_data *)data;

    if (git__prefixcmp(ref, GIT_REFS_TAGS_DIR) != 0)
        return 0; /* no tag */

    if (!(error = git_reference_name_to_id(&oid, d->repo, ref))) {
        if ((error = d->cb(ref, &oid, d->cb_data)) != 0)
            giterr_set_after_callback_function(error, "git_tag_foreach");
    }

    return error;
}