forked from nodegit/nodegit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlfs.h
More file actions
55 lines (45 loc) · 1.46 KB
/
lfs.h
File metadata and controls
55 lines (45 loc) · 1.46 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
#ifndef GITLFS_H
#define GITLFS_H
#include <nan.h>
#include "context.h"
#include "lock_master.h"
#include "lfs_cmd.h"
extern "C" {
#include <git2.h>
}
class GitLFS : public Nan::ObjectWrap {
public:
GitLFS(const GitLFS &other) = delete;
GitLFS(GitLFS &&other) = delete;
GitLFS& operator=(const GitLFS &other) = delete;
GitLFS& operator=(GitLFS &&other) = delete;
static void InitializeComponent(v8::Local<v8::Object> target, nodegit::Context *nodegitContext);
private:
struct InitializeBaton {
int error_code;
const git_error *error;
git_repository *repo;
std::unique_ptr<nodegit::LfsCmd> cmd;
};
class InitializeWorker : public nodegit::AsyncWorker {
public:
InitializeWorker(
InitializeBaton *_baton,
Nan::Callback *callback
) : nodegit::AsyncWorker(callback, "nodegit:AsyncWorker:LFS:Initialize")
, baton(_baton) {};
InitializeWorker(const InitializeWorker &) = delete;
InitializeWorker(InitializeWorker &&) = delete;
InitializeWorker &operator=(const InitializeWorker &) = delete;
InitializeWorker &operator=(InitializeWorker &&) = delete;
~InitializeWorker() {};
void Execute();
void HandleErrorCallback();
void HandleOKCallback();
nodegit::LockMaster AcquireLocks();
private:
InitializeBaton *baton {nullptr};
};
static NAN_METHOD(Initialize);
};
#endif // GITLFS_H