This repository was archived by the owner on Jan 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathtransaction.hpp
More file actions
56 lines (43 loc) · 1.53 KB
/
Copy pathtransaction.hpp
File metadata and controls
56 lines (43 loc) · 1.53 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
#pragma once
#include <cppgit2/git_exception.hpp>
#include <cppgit2/libgit2_api.hpp>
#include <cppgit2/ownership.hpp>
#include <cppgit2/reflog.hpp>
#include <git2.h>
#include <string>
namespace cppgit2 {
class transaction : public libgit2_api {
public:
// Default construct a transaction
transaction();
// Construct from libgit2 C ptr
// If owned by user, free'd in the destructor
transaction(git_transaction *c_ptr, ownership owner = ownership::libgit2);
// Free transaction if owned by user
~transaction();
// Commit changes from this transaction
void commit();
// Lock the specified reference
// This is the first step to updating a reference
void lock_reference(const std::string &refname);
// Remove a reference
void remove_reference(const std::string &refname);
// Set the specified reference's reflog
void set_reflog(const std::string &refname, const reflog &reflog);
// Set the symbolic target of a reference
void set_symbolic_target(const std::string &refname,
const std::string &target,
const signature &signature,
const std::string &message);
// Set the target of a reference
void set_target(const std::string &refname, const oid &target,
const signature &signature, const std::string &message);
// Access the libgit2 C ptr
git_transaction *c_ptr();
const git_transaction *c_ptr() const;
private:
friend class repository;
git_transaction *c_ptr_;
ownership owner_;
};
} // namespace cppgit2