forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.cpp
More file actions
30 lines (25 loc) · 690 Bytes
/
Copy pathstatus.cpp
File metadata and controls
30 lines (25 loc) · 690 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
#include "git2cpp/status.h"
#include "git2cpp/error.h"
namespace git
{
size_t Status::entrycount() const
{
return git_status_list_entrycount(status_);
}
git_status_entry const & Status::operator[] (size_t i) const
{
if (auto res = git_status_byindex(status_, i))
return *res;
else
throw error_t("status entry index out of bounds: " + std::to_string(i));
}
Status::Status(git_repository * repo, git_status_options const & opts)
{
if (git_status_list_new(&status_, repo, &opts))
throw get_status_error();
}
Status::~Status()
{
git_status_list_free(status_);
}
}