forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepo.h
More file actions
105 lines (75 loc) · 2.88 KB
/
Copy pathrepo.h
File metadata and controls
105 lines (75 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma once
#include <string>
#include <vector>
extern "C"
{
#include <git2/repository.h>
}
#include "commit.h"
#include "index.h"
#include "odb.h"
#include "revspec.h"
#include "status.h"
#include "reference.h"
#include "signature.h"
#include "revwalker.h"
#include "tag.h"
#include "blob.h"
#include "str_array.h"
namespace git
{
struct non_existing_branch_error {};
struct missing_head_error {};
struct Repository
{
git_repository * ptr() { return repo_; }
Commit commit_lookup(git_oid const * oid) const;
Tree tree_lookup (git_oid const * oid) const;
Tag tag_lookup (git_oid const * oid) const;
Blob blob_lookup (git_oid const * oid) const;
git_oid merge_base(Revspec::Range const & range) const;
Revspec revparse (const char * spec) const;
Revspec revparse_single (const char * spec) const;
RevWalker rev_walker() const;
git_status_t file_status(const char * filepath) const;
Object entry_to_object(git_tree_entry const * entry) const;
Index index() const;
Odb odb() const;
Signature signature() const;
Status status(git_status_options const &) const;
StrArray reference_list() const;
std::vector<std::string> branches() const;
bool is_bare() const;
Reference head() const;
Reference ref(const char * name) const;
int submodule_lookup(git_submodule *&, const char * name) const;
const char * path() const;
const char * workdir() const;
git_oid create_commit(const char * update_ref,
Signature const & author,
Signature const & commiter,
const char * message_encoding,
const char * message,
Tree const & tree);
git_oid create_commit(const char * update_ref,
Signature const & author,
Signature const & commiter,
const char * message_encoding,
const char * message,
Tree const & tree,
Commit const & parent);
explicit Repository(std::string const & dir);
struct init_tag {};
static init_tag init;
Repository(std::string const & dir, init_tag);
Repository(std::string const & dir, init_tag,
git_repository_init_options opts);
Repository (Repository const &) = delete;
Repository& operator = (Repository const &) = delete;
Repository(Repository &&);
~Repository();
private:
git_repository * repo_;
};
Object revparse_single(Repository const & repo, const char * spec);
}