navid/veins / ac26a51bd7b5f4a22beb0ca203a433857c68b337b79aa5ce14683290ab9ae3a7 / xveins/src/git/git.h

git.h

← xveins/src/git · 1124 bytes · raw · download

#pragma once

#include "core/common.h"
#include "object/object.h"

#include <optional>
#include <string>
#include <vector>

namespace vn {

int git_import(const fs::path& root);
void git_import_configure_remote(const fs::path& root, std::string_view url, std::string_view name);
int git_export(const fs::path& root);
int git_materialize(const fs::path& root);
int git_fetch(const fs::path& root, std::string_view remote);
int git_push(const fs::path& root, std::string_view remote, std::string_view bookmark);

struct GitMirrorOptions {
    bool force = true;
    bool prune = false;
    bool dry_run = false;
    bool strict = false;
};

int git_mirror_push(const fs::path& root, std::string_view remote, const GitMirrorOptions& options);
int git_mirror_tag(const fs::path& root, std::string_view remote, std::string_view tag,
                   const GitMirrorOptions& options);

int git_prepare_mirror(const fs::path& root, std::string_view source);
std::optional<std::vector<std::uint8_t>> git_read_lazy_blob(const fs::path& root, const Id& id);
int git_cli_run(const std::vector<std::string>& args);

} // namespace vn