Commit b2395a82 by Krzysztof Adamski Committed by Russell Belfer

Only use callbacks when -n or -v in add example.

parent 04fd2665
...@@ -42,9 +42,7 @@ int print_matched_cb(const char *path, const char *matched_pathspec, void *paylo ...@@ -42,9 +42,7 @@ int print_matched_cb(const char *path, const char *matched_pathspec, void *paylo
if (status & GIT_STATUS_WT_MODIFIED || if (status & GIT_STATUS_WT_MODIFIED ||
status & GIT_STATUS_WT_NEW) { status & GIT_STATUS_WT_NEW) {
if (p.options & VERBOSE || p.options & SKIP) {
printf("add '%s'\n", path); printf("add '%s'\n", path);
}
ret = 0; ret = 0;
} else { } else {
ret = 1; ret = 1;
...@@ -120,7 +118,9 @@ int main (int argc, char** argv) ...@@ -120,7 +118,9 @@ int main (int argc, char** argv)
return 1; return 1;
} }
if (options&VERBOSE || options&SKIP) {
matched_cb = &print_matched_cb; matched_cb = &print_matched_cb;
}
payload.options = options; payload.options = options;
payload.repo = repo; payload.repo = repo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment