forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrevwalker.h
More file actions
62 lines (49 loc) · 1.38 KB
/
Copy pathrevwalker.h
File metadata and controls
62 lines (49 loc) · 1.38 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
#pragma once
#include "tagged_mask.h"
#include "commit.h"
namespace git
{
struct Repository;
namespace revwalker {
namespace sorting
{
typedef tagged_mask_t<struct tag> type;
extern const type none;
extern const type topological;
extern const type time;
extern const type reverse;
}}
struct RevWalker
{
RevWalker(git_revwalk * walker, Repository const & repo)
: walker_(walker)
, repo_(&repo)
{}
~RevWalker();
void sort(revwalker::sorting::type);
void simplify_first_parent();
void push_head() const;
void hide(git_oid const &) const;
void push(git_oid const &) const;
Commit next() const;
bool next(char * id_buffer) const;
RevWalker (RevWalker const &) = delete;
RevWalker& operator = (RevWalker const &) = delete;
RevWalker(RevWalker && other)
: walker_(other.walker_)
, repo_(other.repo_)
{
other.walker_ = nullptr;
}
RevWalker& operator = (RevWalker && other)
{
walker_ = other.walker_;
repo_ = other.repo_;
other.walker_ = nullptr;
return *this;
}
private:
git_revwalk * walker_;
Repository const * repo_;
};
}