/* This file is part of FediBlock-backend. * Copyright © 2020 tastytea * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ #ifndef FEDIBLOCK_BACKEND_GIT_HPP #define FEDIBLOCK_BACKEND_GIT_HPP #include "types.hpp" #include #include #include namespace FediBlock::git { using std::string; using std::uint64_t; // Throw runtime_error on error. void check(int error); // Acquire credentials for SSH. int cred_acquire(git_cred **cred, const char *url, const char *username_from_url, unsigned int allowed_types, void *payload); // Clone the git repo. void clone(); // Make a new branch for preparing the pull request. void create_branch(); // Make a new commit. void commit(const entry_type &entry); // Push the new commit. void push(); // Get the name of the branch we use. string get_branch_name(); } // namespace FediBlock::git #endif // FEDIBLOCK_BACKEND_GIT_HPP