mirror of
https://git.proxmox.com/git/libgit2
synced 2026-02-01 19:03:40 +00:00
Only use callbacks when -n or -v in add example.
This commit is contained in:
parent
04fd266584
commit
b2395a8267
@ -42,9 +42,7 @@ int print_matched_cb(const char *path, const char *matched_pathspec, void *paylo
|
||||
|
||||
if (status & GIT_STATUS_WT_MODIFIED ||
|
||||
status & GIT_STATUS_WT_NEW) {
|
||||
if (p.options & VERBOSE || p.options & SKIP) {
|
||||
printf("add '%s'\n", path);
|
||||
}
|
||||
printf("add '%s'\n", path);
|
||||
ret = 0;
|
||||
} else {
|
||||
ret = 1;
|
||||
@ -120,7 +118,9 @@ int main (int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
matched_cb = &print_matched_cb;
|
||||
if (options&VERBOSE || options&SKIP) {
|
||||
matched_cb = &print_matched_cb;
|
||||
}
|
||||
|
||||
payload.options = options;
|
||||
payload.repo = repo;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user