]> git.armaanb.net Git - stagit.git/commitdiff
small code cleanup: no need for status variable
authorHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 1 May 2016 17:08:36 +0000 (19:08 +0200)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Sun, 1 May 2016 17:09:26 +0000 (19:09 +0200)
stagit.c

index d63607794b50d38c2ea9ad14ea620b7bf0c114b1..7c527785c69d4c4a74fb91254ec75c3e04362a86 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -1013,7 +1013,6 @@ main(int argc, char *argv[])
        const git_error *e = NULL;
        FILE *fp, *fpread;
        char path[PATH_MAX], repodirabs[PATH_MAX + 1], *p;
-       int status;
 
        if (argc != 2) {
                fprintf(stderr, "%s <repodir>\n", argv[0]);
@@ -1026,11 +1025,11 @@ main(int argc, char *argv[])
 
        git_libgit2_init();
 
-       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) < 0) {
                e = giterr_last();
                fprintf(stderr, "%s: %s\n", argv[0], e->message);
-               return status;
+               return 1;
        }
 
        /* find HEAD */