Plugin to add Pijul support to the Nix package manager
#ifndef NIX_PLUGIN_PIJUL_REPO_H
#define NIX_PLUGIN_PIJUL_REPO_H

#include "compat.h"

#include <optional>
#include <set>

#include <date/date.h>

namespace nixpluginpijul
{

struct RepoStatus {
    std::string channel;
    std::string state;
    uint64_t lastModified;
};

void clone(const std::string_view &repoUrl,
           const Path &repoDir,
           const std::optional<std::string_view> &channel = {},
           const std::optional<std::string_view> &state = {});

void record(const std::string_view &message, const Path &repoDir, const std::vector<Path> &paths = {});

bool isRepoDirty(const Path &repoDir);

std::set<Path> getTrackedFiles(const Path &repoDir);

RepoStatus getRepoStatus(const Path &repoPath);

std::pair<std::string, uint64_t> getState(const Path &repoPath);

std::string getRepoChannel(const Path &repoPath);

date::sys_time<std::chrono::milliseconds> parseRFC3339(const std::string &spec);

}

#endif // NIX_PLUGIN_PIJUL_REPO_H