From b2395a826780c84640c3bd5d3ccec51d34086524 Mon Sep 17 00:00:00 2001 From: Krzysztof Adamski Date: Wed, 4 Sep 2013 18:49:10 +0200 Subject: [PATCH] Only use callbacks when -n or -v in add example. --- examples/add.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/add.c b/examples/add.c index 96595f895..cab57dca7 100644 --- a/examples/add.c +++ b/examples/add.c @@ -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;