Skip to content

Commit 70ba192

Browse files
committed
LFS object
1 parent 3f8616f commit 70ba192

5 files changed

Lines changed: 36 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#ifndef GITLFS_H
2+
#define GITLFS_H
3+
4+
#include <nan.h>
5+
#include "context.h"
6+
7+
class GitLFS : public Nan::ObjectWrap {
8+
public:
9+
GitLFS(const GitLFS &other) = delete;
10+
GitLFS(GitLFS &&other) = delete;
11+
GitLFS& operator=(const GitLFS &other) = delete;
12+
GitLFS& operator=(GitLFS &&other) = delete;
13+
14+
static void InitializeComponent(v8::Local<v8::Object> target, nodegit::Context *nodegitContext);
15+
};
16+
17+
#endif // GITLFS_H
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#include <nan.h>
2+
#include "../include/nodegit.h"
3+
#include "../include/context.h"
4+
#include "../include/lfs.h"
5+
6+
using namespace v8;
7+
8+
void GitLFS::InitializeComponent(v8::Local<v8::Object> target, nodegit::Context *nodegitContext) {
9+
Nan::HandleScope scope;
10+
11+
v8::Local<Object> lfs = Nan::New<Object>();
12+
13+
Nan::Set(target, Nan::New<String>("LFS").ToLocalChecked(), lfs);
14+
nodegitContext->SaveToPersistent("LFS", lfs);
15+
}

generate/templates/templates/binding.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
"src/context.cc",
6969
"src/v8_helpers.cc",
7070
"src/tracker_wrap.cc",
71+
"src/lfs.cc",
7172
{% each %}
7273
{% if type != "enum" %}
7374
"src/{{ name }}.cc",

generate/templates/templates/nodegit.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "../include/convenient_patch.h"
2424
#include "../include/convenient_hunk.h"
2525
#include "../include/filter_registry.h"
26+
#include "../include/lfs.h"
2627

2728
using namespace v8;
2829

@@ -121,6 +122,7 @@ NAN_MODULE_INIT(init) {
121122
ConvenientHunk::InitializeComponent(target, nodegitContext);
122123
ConvenientPatch::InitializeComponent(target, nodegitContext);
123124
GitFilterRegistry::InitializeComponent(target, nodegitContext);
125+
GitLFS::InitializeComponent(target, nodegitContext);
124126

125127
nodegit::LockMaster::InitializeContext();
126128
}

generate/templates/templates/nodegit.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ require("./enums.js");
116116
// Import extensions
117117
// [Manual] extensions
118118
importExtension("filter_registry");
119+
importExtension("lfs");
119120
{% each %}
120121
{% if type != "enum" %}
121122
importExtension("{{ filename }}");

0 commit comments

Comments
 (0)