forked from AndreyG/libgit2cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignature.cpp
More file actions
30 lines (25 loc) · 737 Bytes
/
Copy pathsignature.cpp
File metadata and controls
30 lines (25 loc) · 737 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
#include <git2/signature.h>
#include "git2cpp/error.h"
#include "git2cpp/signature.h"
#include <git2/errors.h>
namespace git
{
Signature::Signature(git_repository * repo)
{
git_signature * sig;
if (git_signature_default(&sig, repo) != GIT_OK)
throw signature_create_error();
sig_.reset(sig);
}
Signature::Signature(const char * name, const char * email, git_time_t time, int offset)
{
git_signature * sig;
if (git_signature_new(&sig, name, email, time, offset) != GIT_OK)
throw signature_create_error();
sig_.reset(sig);
}
void Signature::Destroy::operator()(git_signature* sig) const
{
git_signature_free(sig);
}
}