diff options
-rw-r--r-- | pkgrel.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -119,6 +119,7 @@ main(int argc, char* argv[]) git_tree* earlier = NULL; git_tree* later = NULL; int rel = 1; + int occurred = 0; while (0 == git_revwalk_next(&oid, walker)) { git_commit* commit; try_git(git_commit_lookup(&commit, repo, &oid), "finding commit"); @@ -135,10 +136,15 @@ main(int argc, char* argv[]) try_git(git_diff_foreach(diff, NULL, NULL, NULL, &line_line, &matched), "searching lines"); git_diff_free(diff); git_commit_free(commit); + if (MATCH_RESULT_INITIAL != matched) + occurred = 1; if (MATCH_RESULT_FOUND == matched) break; - if (MATCH_RESULT_INITIAL != matched) + if (MATCH_RESULT_NOTFOUND == matched) rel++; } - printf("%d\n", rel); + if (0 == occurred) + dprintf(2, "PKGBUILD not found\n"); + else + printf("%d\n", rel); } |