Repository navigation
Adding git_filter support in nodegit #1331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
4e34797
f4f7a4d
3844f98
172e4ad
60c1866
339799e
718e101
8c6d2a5
debcf21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,9 +15,15 @@ module.exports = function(args) { | |
|
|
||
| if (cArg === args.length -1) { | ||
| arg.lastArg = true; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entire block is: arg.lastArg = cArg === args.length - 1;
arg.firstArg = !arg.lastArg && cArg === 0; |
||
| arg.firstArg = false; | ||
| } | ||
| else if(cArg === 0){ | ||
| arg.firstArg = true; | ||
| arg.lastArg = false; | ||
| } | ||
| else { | ||
| arg.lastArg = false; | ||
| arg.firstArg = false; | ||
| } | ||
|
|
||
| arg.cArg = cArg; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module.exports = function(value, other) { | ||
| return (value - other); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't need parentheses. |
||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| module.exports = function(value) { | ||
| return value < 0 ? 0 : value; | ||
| }; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,4 +60,40 @@ struct AsyncBatonWithResult : public AsyncBaton { | |
| } | ||
| }; | ||
|
|
||
| struct AsyncBatonWithNoResult : public AsyncBaton { | ||
| /* ResultT result; | ||
| ResultT defaultResult;*/ // result returned if the callback doesn't return anything valid | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This comment does not apply to this structure. |
||
| void (*onCompletion)(AsyncBaton *); | ||
|
|
||
| void Done() { | ||
| if (onCompletion) { | ||
| onCompletion(this); | ||
| } else { | ||
| // signal completion | ||
| uv_sem_post(&semaphore); | ||
| } | ||
| } | ||
|
|
||
| void ExecuteAsync(ThreadPool::Callback asyncCallback, void (*onCompletion)(AsyncBaton *) = NULL) { | ||
| this->onCompletion = onCompletion; | ||
| if (!onCompletion) { | ||
| uv_sem_init(&semaphore, 0); | ||
| } | ||
|
|
||
| { | ||
| LockMaster::TemporaryUnlock temporaryUnlock; | ||
|
|
||
| libgit2ThreadPool.ExecuteReverseCallback(asyncCallback, this); | ||
|
|
||
| if (!onCompletion) { | ||
| // wait for completion | ||
| uv_sem_wait(&semaphore); | ||
| uv_sem_destroy(&semaphore); | ||
| } | ||
| } | ||
|
|
||
| return; | ||
| } | ||
| }; | ||
|
|
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment needed anymore?