]> git.armaanb.net Git - stagit.git/commitdiff
stagit-index: continue making list, but return error code
authorHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 5 Jan 2016 21:30:59 +0000 (22:30 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Tue, 5 Jan 2016 21:30:59 +0000 (22:30 +0100)
stagit-index.c

index 7eb74ea0ab8c0b85cb5b3ff33c2abc78e1e6bc0c..540fda1b9b40315a030146fc9884f35eef5c0e49 100644 (file)
@@ -169,7 +169,7 @@ main(int argc, char *argv[])
        const git_error *e = NULL;
        FILE *fp;
        char path[PATH_MAX], *p;
-       int i, status;
+       int i, ret = 0;
 
        if (argc < 2) {
                fprintf(stderr, "%s [repodir...]\n", argv[0]);
@@ -182,11 +182,12 @@ main(int argc, char *argv[])
        for (i = 1; i < argc; i++) {
                repodir = argv[i];
 
-               if ((status = git_repository_open_ext(&repo, repodir,
-                       GIT_REPOSITORY_OPEN_NO_SEARCH, NULL)) < 0) {
+               if (git_repository_open_ext(&repo, repodir,
+                   GIT_REPOSITORY_OPEN_NO_SEARCH, NULL)) {
                        e = giterr_last();
-                       fprintf(stderr, "error %d/%d: %s\n", status, e->klass, e->message);
-                       return status;
+                       fprintf(stderr, "%s: %s\n", argv[0], e->message);
+                       ret = 1;
+                       continue;
                }
 
                /* use directory name as name */
@@ -232,5 +233,5 @@ main(int argc, char *argv[])
        git_repository_free(repo);
        git_libgit2_shutdown();
 
-       return 0;
+       return ret;
 }