Esempio n. 1
0
static int do_git_load(git_repository *repo, const char *branch)
{
	int ret;
	git_object *object;
	git_commit *commit;
	git_tree *tree;

	ret = find_commit(repo, branch, &commit);
	if (ret)
		return ret;
	if (git_commit_tree(&tree, commit))
		return report_error("Could not look up tree of commit in branch '%s'", branch);
	ret = load_dives_from_tree(repo, tree);
	if (!ret)
		set_git_id(git_commit_id(commit));
	git_object_free((git_object *)tree);
	return ret;
}
Esempio n. 2
0
static int do_git_load(git_repository *repo, const char *branch)
{
	int ret;
	git_object *object;
	git_commit *commit;
	git_tree *tree;

	if (git_revparse_single(&object, repo, branch))
		return report_error("Unable to look up revision '%s'", branch);
	if (git_object_peel((git_object **)&commit, object, GIT_OBJ_COMMIT))
		return report_error("Revision '%s' is not a valid commit", branch);
	if (git_commit_tree(&tree, commit))
		return report_error("Could not look up tree of commit in branch '%s'", branch);
	ret = load_dives_from_tree(repo, tree);
	if (!ret)
		set_git_id(git_commit_id(commit));
	git_object_free((git_object *)tree);
	return ret;
}
Esempio n. 3
0
static int do_git_load(git_repository *repo, const char *branch)
{
	int ret;
	git_commit *commit;
	git_tree *tree;

	git_storage_update_progress(false, "do_git_load, find the commit");
	ret = find_commit(repo, branch, &commit);
	if (ret)
		return ret;
	git_storage_update_progress(false, "git commit tree");
	if (git_commit_tree(&tree, commit))
		return report_error("Could not look up tree of commit in branch '%s'", branch);
	git_storage_update_progress(false, "load dives from tree");
	ret = load_dives_from_tree(repo, tree);
	if (!ret)
		set_git_id(git_commit_id(commit));
	git_object_free((git_object *)tree);
	git_storage_update_progress(false, "done do_git_load");
	return ret;
}