fix compile: libgit2 0.28 changed giterr_last to git_error_last - stagit-gopher - A git gopher frontend. (mirror)
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/
Log
Files
Refs
Tags
README
LICENSE
---
commit 8dc7c20dfe3d6a8bb41d4f245e1bbe5965209b3b
parent c2563a0ef6a3aad37cc234e2bfd9456c615917a9
Author: Hiltjo Posthuma 
Date:   Sun,  3 Feb 2019 15:26:42 +0100

fix compile: libgit2 0.28 changed giterr_last to git_error_last

libgit2 commit:
https://github.com/libgit2/libgit2/commit/a27a4de6f8003961d38958893c6c637395c7cc04

Diffstat:
  M stagit-gopher-index.c               |       4 +---
  M stagit-gopher.c                     |       4 +---

2 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c
@@ -210,7 +210,6 @@ usage(const char *argv0)
 int
 main(int argc, char *argv[])
 {
-        const git_error *e = NULL;
         FILE *fp;
         char path[PATH_MAX], repodirabs[PATH_MAX + 1];
         const char *repodir = NULL;
@@ -242,8 +241,7 @@ main(int argc, char *argv[])
 
                 if (git_repository_open_ext(&repo, repodir,
                     GIT_REPOSITORY_OPEN_NO_SEARCH, NULL)) {
-                        e = giterr_last();
-                        fprintf(stderr, "%s: %s\n", argv[0], e->message);
+                        fprintf(stderr, "%s: cannot open repository\n", argv[0]);
                         ret = 1;
                         continue;
                 }
diff --git a/stagit-gopher.c b/stagit-gopher.c
@@ -1136,7 +1136,6 @@ main(int argc, char *argv[])
 {
         git_object *obj = NULL;
         const git_oid *head = NULL;
-        const git_error *e = NULL;
         mode_t mask;
         FILE *fp, *fpread;
         char path[PATH_MAX], repodirabs[PATH_MAX + 1], *p;
@@ -1189,8 +1188,7 @@ main(int argc, char *argv[])
 
         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);
+                fprintf(stderr, "%s: cannot open repository\n", argv[0]);
                 return 1;
         }