FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Updated v0.18.0.json to make the index and DiffOptions arguments in Inde... by kmctown · Pull Request #106 · nodegit/nodegit · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .cc  (1) .json  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
18 changes: 10 additions & 8 deletions src/index.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,6 @@ Handle<Value> GitIndex::IndexToWorkdir(const Arguments& args) {
if (args.Length() == 0 || !args[0]->IsObject()) {
return ThrowException(Exception::Error(String::New("Repository repo is required.")));
}
if (args.Length() == 1 || !args[1]->IsObject()) {
return ThrowException(Exception::Error(String::New("Index index is required.")));
}
if (args.Length() == 2 || !args[2]->IsObject()) {
return ThrowException(Exception::Error(String::New("DiffOptions opts is required.")));
}

if (args.Length() == 3 || !args[3]->IsFunction()) {
return ThrowException(Exception::Error(String::New("Callback is required and must be a Function.")));
Expand All @@ -792,12 +786,20 @@ Handle<Value> GitIndex::IndexToWorkdir(const Arguments& args) {
baton->repo = from_repo;
baton->indexReference = Persistent<Value>::New(args[1]);
git_index * from_index;
if (args[1]->IsObject()) {
from_index = ObjectWrap::Unwrap<GitIndex>(args[1]->ToObject())->GetValue();
baton->index = from_index;
} else {
from_index = 0;
}
baton->index = from_index;
baton->optsReference = Persistent<Value>::New(args[2]);
const git_diff_options * from_opts;
if (args[2]->IsObject()) {
from_opts = ObjectWrap::Unwrap<GitDiffOptions>(args[2]->ToObject())->GetValue();
baton->opts = from_opts;
} else {
from_opts = 0;
}
baton->opts = from_opts;
baton->callback = Persistent<Function>::New(Local<Function>::Cast(args[3]));

uv_queue_work(uv_default_loop(), &baton->request, IndexToWorkdirWork, (uv_after_work_cb)IndexToWorkdirAfterWork);
Expand Down
2 changes: 2 additions & 0 deletions v0.18.0.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -5439,13 +5439,15 @@
"cType": "git_index *",
"cppClassName": "GitIndex",
"jsClassName": "Index",
"isOptional": true,
"comment": "The index to diff from; repo index used if NULL."
},
{
"name": "opts",
"cType": "const git_diff_options *",
"cppClassName": "GitDiffOptions",
"jsClassName": "DiffOptions",
"isOptional": true,
"comment": "Structure with options to influence diff or NULL for defaults."
}
],
Expand Down

Back | FazBrowse Home | New Git URL