Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions 10 src/branch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Handle<Value> Branch::Create(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number force is required.")));
}

git_reference *out = NULL;
git_reference * out = 0;
git_repository * from_repo;
from_repo = ObjectWrap::Unwrap<GitRepo>(args[0]->ToObject())->GetValue();
const char * from_branch_name;
Expand Down Expand Up @@ -220,7 +220,7 @@ Handle<Value> Branch::Move(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number force is required.")));
}

git_reference *out = NULL;
git_reference * out = 0;
git_reference * from_branch;
from_branch = ObjectWrap::Unwrap<GitReference>(args[0]->ToObject())->GetValue();
const char * from_new_branch_name;
Expand Down Expand Up @@ -271,7 +271,7 @@ Handle<Value> Branch::Lookup(const Arguments& args) {
return ThrowException(Exception::Error(String::New("BranchT branch_type is required.")));
}

git_reference *out = NULL;
git_reference * out = 0;
git_repository * from_repo;
from_repo = ObjectWrap::Unwrap<GitRepo>(args[0]->ToObject())->GetValue();
const char * from_branch_name;
Expand Down Expand Up @@ -314,7 +314,7 @@ Handle<Value> Branch::Name(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Reference ref is required.")));
}

const char *out = NULL;
const char * out = 0;
git_reference * from_ref;
from_ref = ObjectWrap::Unwrap<GitReference>(args[0]->ToObject())->GetValue();

Expand Down Expand Up @@ -345,7 +345,7 @@ Handle<Value> Branch::Upstream(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Reference branch is required.")));
}

git_reference *out = NULL;
git_reference * out = 0;
git_reference * from_branch;
from_branch = ObjectWrap::Unwrap<GitReference>(args[0]->ToObject())->GetValue();

Expand Down
2 changes: 1 addition & 1 deletion 2 src/commit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ Handle<Value> GitCommit::NthGenAncestor(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number n is required.")));
}

git_commit *ancestor = NULL;
git_commit * ancestor = 0;
unsigned int from_n;
from_n = (unsigned int) args[0]->ToUint32()->Value();

Expand Down
4 changes: 2 additions & 2 deletions 4 src/diff_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ Handle<Value> GitDiffList::Patch(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number idx is required.")));
}

git_diff_patch *patch_out = NULL;
const git_diff_delta *delta_out = NULL;
git_diff_patch * patch_out = 0;
const git_diff_delta * delta_out = 0;
size_t from_idx;
from_idx = (size_t) args[0]->ToUint32()->Value();

Expand Down
19 changes: 7 additions & 12 deletions 19 src/index.cc
Original file line number Diff line number Diff line change
Expand Up @@ -676,34 +676,29 @@ Handle<Value> GitIndex::RemoveBypath(const Arguments& args) {
}

/**
* @param {Number} at_pos
* @param {String} path
* @return {Number} result
* @return {Number} at_pos
*/
Handle<Value> GitIndex::Find(const Arguments& args) {
HandleScope scope;
if (args.Length() == 0 || !args[0]->IsUint32()) {
return ThrowException(Exception::Error(String::New("Number at_pos is required.")));
}
if (args.Length() == 1 || !args[1]->IsString()) {
if (args.Length() == 0 || !args[0]->IsString()) {
return ThrowException(Exception::Error(String::New("String path is required.")));
}

size_t * from_at_pos;
from_at_pos = (size_t *) args[0]->ToUint32()->Value();
const char * from_path;
String::Utf8Value path(args[1]->ToString());
size_t at_pos = 0;
const char * from_path;
String::Utf8Value path(args[0]->ToString());
from_path = strdup(*path);

int result = git_index_find(
from_at_pos
&at_pos
, ObjectWrap::Unwrap<GitIndex>(args.This())->GetValue()
, from_path
);
free((void *)from_path);

Handle<Value> to;
to = Int32::New(result);
to = Uint32::New(at_pos);
return scope.Close(to);
}

Expand Down
50 changes: 25 additions & 25 deletions 50 src/odb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ git_odb *GitOdb::GetValue() {
Handle<Value> GitOdb::Create(const Arguments& args) {
HandleScope scope;

git_odb *out = NULL;
git_odb * out = 0;

int result = git_odb_new(
&out
Expand Down Expand Up @@ -112,7 +112,7 @@ Handle<Value> GitOdb::Open(const Arguments& args) {
return ThrowException(Exception::Error(String::New("String objects_dir is required.")));
}

git_odb *out = NULL;
git_odb * out = 0;
const char * from_objects_dir;
String::Utf8Value objects_dir(args[0]->ToString());
from_objects_dir = strdup(*objects_dir);
Expand Down Expand Up @@ -268,7 +268,7 @@ Handle<Value> GitOdb::ReadPrefix(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number len is required.")));
}

git_odb_object *out = NULL;
git_odb_object * out = 0;
git_odb * from_db;
from_db = ObjectWrap::Unwrap<GitOdb>(args[0]->ToObject())->GetValue();
const git_oid * from_short_id;
Expand Down Expand Up @@ -300,38 +300,30 @@ Handle<Value> GitOdb::ReadPrefix(const Arguments& args) {
}

/**
* @param {Number} len_out
* @param {Number} type_out
* @param {Odb} db
* @param {Oid} id
* @return {Number} len_out
* @return {Number} type_out
*/
Handle<Value> GitOdb::ReadHeader(const Arguments& args) {
HandleScope scope;
if (args.Length() == 0 || !args[0]->IsUint32()) {
return ThrowException(Exception::Error(String::New("Number len_out is required.")));
}
if (args.Length() == 1 || !args[1]->IsInt32()) {
return ThrowException(Exception::Error(String::New("Number type_out is required.")));
}
if (args.Length() == 2 || !args[2]->IsObject()) {
if (args.Length() == 0 || !args[0]->IsObject()) {
return ThrowException(Exception::Error(String::New("Odb db is required.")));
}
if (args.Length() == 3 || !args[3]->IsObject()) {
if (args.Length() == 1 || !args[1]->IsObject()) {
return ThrowException(Exception::Error(String::New("Oid id is required.")));
}

size_t * from_len_out;
from_len_out = (size_t *) args[0]->ToUint32()->Value();
git_otype * from_type_out;
from_type_out = (git_otype *) args[1]->ToInt32()->Value();
git_odb * from_db;
from_db = ObjectWrap::Unwrap<GitOdb>(args[2]->ToObject())->GetValue();
size_t len_out = 0;
git_otype type_out = GIT_OBJ_ANY;
git_odb * from_db;
from_db = ObjectWrap::Unwrap<GitOdb>(args[0]->ToObject())->GetValue();
const git_oid * from_id;
from_id = ObjectWrap::Unwrap<GitOid>(args[3]->ToObject())->GetValue();
from_id = ObjectWrap::Unwrap<GitOid>(args[1]->ToObject())->GetValue();

int result = git_odb_read_header(
from_len_out
, from_type_out
&len_out
, &type_out
, from_db
, from_id
);
Expand All @@ -343,7 +335,15 @@ Handle<Value> GitOdb::ReadHeader(const Arguments& args) {
}
}

return Undefined();
Handle<Object> toReturn = Object::New();
Handle<Value> to;
to = Uint32::New(len_out);
toReturn->Set(String::NewSymbol("len_out"), to);

to = Int32::New(type_out);
toReturn->Set(String::NewSymbol("type_out"), to);

return scope.Close(toReturn);
}

/**
Expand Down Expand Up @@ -517,7 +517,7 @@ Handle<Value> GitOdb::Hash(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number type is required.")));
}

git_oid *out = (git_oid *)malloc(sizeof(git_oid ));
git_oid *out = (git_oid *)malloc(sizeof(git_oid));
const void * from_data;
from_data = Buffer::Data(args[0]->ToObject());
size_t from_len;
Expand Down Expand Up @@ -563,7 +563,7 @@ Handle<Value> GitOdb::Hashfile(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number type is required.")));
}

git_oid *out = (git_oid *)malloc(sizeof(git_oid ));
git_oid *out = (git_oid *)malloc(sizeof(git_oid));
const char * from_path;
String::Utf8Value path(args[0]->ToString());
from_path = strdup(*path);
Expand Down
2 changes: 1 addition & 1 deletion 2 src/oid.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Handle<Value> GitOid::FromString(const Arguments& args) {
return ThrowException(Exception::Error(String::New("String str is required.")));
}

git_oid *out = (git_oid *)malloc(sizeof(git_oid ));
git_oid *out = (git_oid *)malloc(sizeof(git_oid));
const char * from_str;
String::Utf8Value str(args[0]->ToString());
from_str = strdup(*str);
Expand Down
26 changes: 13 additions & 13 deletions 26 src/patch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ Handle<Value> GitPatch::Size(const Arguments& args) {
Handle<Value> GitPatch::Stats(const Arguments& args) {
HandleScope scope;

size_t total_context = NULL;
size_t total_additions = NULL;
size_t total_deletions = NULL;
size_t total_context = 0;
size_t total_additions = 0;
size_t total_deletions = 0;

int result = git_diff_patch_line_stats(
&total_context
Expand Down Expand Up @@ -161,10 +161,10 @@ Handle<Value> GitPatch::Hunk(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number hunk_idx is required.")));
}

const git_diff_range *range = NULL;
const char *header = NULL;
size_t header_len = NULL;
size_t lines_in_hunk = NULL;
const git_diff_range * range = 0;
const char * header = 0;
size_t header_len = 0;
size_t lines_in_hunk = 0;
size_t from_hunk_idx;
from_hunk_idx = (size_t) args[0]->ToUint32()->Value();

Expand Down Expand Up @@ -249,11 +249,11 @@ Handle<Value> GitPatch::Line(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number line_of_hunk is required.")));
}

char line_origin = NULL;
const char *content = NULL;
size_t content_len = NULL;
int old_lineno = NULL;
int new_lineno = NULL;
char line_origin = 0;
const char * content = 0;
size_t content_len = 0;
int old_lineno = 0;
int new_lineno = 0;
size_t from_hunk_idx;
from_hunk_idx = (size_t) args[0]->ToUint32()->Value();
size_t from_line_of_hunk;
Expand Down Expand Up @@ -303,7 +303,7 @@ Handle<Value> GitPatch::Line(const Arguments& args) {
Handle<Value> GitPatch::ToString(const Arguments& args) {
HandleScope scope;

char *string = NULL;
char * string = 0;

int result = git_diff_patch_to_str(
&string
Expand Down
6 changes: 3 additions & 3 deletions 6 src/reference.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ Handle<Value> GitReference::SetSymbolicTarget(const Arguments& args) {
return ThrowException(Exception::Error(String::New("String target is required.")));
}

git_reference *out = NULL;
git_reference * out = 0;
const char * from_target;
String::Utf8Value target(args[0]->ToString());
from_target = strdup(*target);
Expand Down Expand Up @@ -360,7 +360,7 @@ Handle<Value> GitReference::setTarget(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Oid id is required.")));
}

git_reference *out = NULL;
git_reference * out = 0;
const git_oid * from_id;
from_id = ObjectWrap::Unwrap<GitOid>(args[0]->ToObject())->GetValue();

Expand Down Expand Up @@ -594,7 +594,7 @@ Handle<Value> GitReference::Peel(const Arguments& args) {
return ThrowException(Exception::Error(String::New("Number type is required.")));
}

git_object *out = NULL;
git_object * out = 0;
git_otype from_type;
from_type = (git_otype) args[0]->ToInt32()->Value();

Expand Down
2 changes: 1 addition & 1 deletion 2 src/remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ Handle<Value> GitRemote::Download(const Arguments& args) {
if (args[0]->IsFunction()) {
Persistent<Function>::New(Local<Function>::Cast(args[0]));
} else {
from_progress_cb = NULL;
from_progress_cb = 0;
}
baton->progress_cb = from_progress_cb;
baton->payloadReference = Persistent<Value>::New(args[1]);
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.