summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkgrel.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgrel.c b/pkgrel.c
index d3b2749..22adc8e 100644
--- a/pkgrel.c
+++ b/pkgrel.c
@@ -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);
}