2020-07-01 03:51:00 +02:00
|
|
|
/* This file is part of FediBlock-backend.
|
|
|
|
* Copyright © 2020 tastytea <tastytea@tastytea.de>
|
|
|
|
*
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FEDIBLOCK_BACKEND_GIT_HPP
|
|
|
|
#define FEDIBLOCK_BACKEND_GIT_HPP
|
|
|
|
|
2020-07-01 08:48:36 +02:00
|
|
|
#include "cgi.hpp"
|
|
|
|
|
2020-07-01 03:51:00 +02:00
|
|
|
#include <cstdint>
|
|
|
|
|
2020-07-01 08:50:16 +02:00
|
|
|
namespace FediBlock::git
|
2020-07-01 03:51:00 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
using std::uint64_t;
|
|
|
|
|
2020-07-01 04:38:08 +02:00
|
|
|
// Throws runtime_error on error.
|
|
|
|
void check_git_error(int error);
|
|
|
|
|
2020-07-01 03:51:00 +02:00
|
|
|
// Clone the git repo.
|
|
|
|
void clone_repo();
|
|
|
|
|
|
|
|
// FIXME: This will collapse when branches are deleted, use pull request IDs?
|
|
|
|
// Get highest branch-ID in use.
|
|
|
|
[[nodiscard]] uint64_t get_last_id();
|
|
|
|
|
|
|
|
// Make a new branch for preparing the pull request.
|
|
|
|
void make_new_branch();
|
|
|
|
|
2020-07-01 08:48:36 +02:00
|
|
|
// Make a new commit.
|
|
|
|
void make_commit(const entry_type &entry);
|
2020-07-01 03:51:00 +02:00
|
|
|
|
2020-07-01 08:50:16 +02:00
|
|
|
} // namespace FediBlock::git
|
2020-07-01 03:51:00 +02:00
|
|
|
|
|
|
|
#endif // FEDIBLOCK_BACKEND_GIT_HPP
|