-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathrevwalker.h
More file actions
46 lines (37 loc) · 1021 Bytes
/
Copy pathrevwalker.h
File metadata and controls
46 lines (37 loc) · 1021 Bytes
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
#pragma once
#include "commit.h"
#include "tagged_mask.h"
#include <utility>
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)
{}
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;
private:
struct Destroy { void operator() (git_revwalk*) const; };
std::unique_ptr<git_revwalk, Destroy> walker_;
Repository const * repo_;
};
}