From f4745953b531870f01a00aa4b5f73d305a34fc48 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Tue, 2 Aug 2016 10:23:39 -0300 Subject: [PATCH] sch2fig/git-file.c (select_repo): we actually iterated, but did it wrong --- sch2fig/TODO | 2 -- sch2fig/git-file.c | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sch2fig/TODO b/sch2fig/TODO index 8877a74..a2e2899 100644 --- a/sch2fig/TODO +++ b/sch2fig/TODO @@ -22,5 +22,3 @@ - move path name guessing into file.c - return indication of whether diff found any differences - in diff, pass only options understood by cairo_png -- git_repository_open_ext does not open repo if the path points to a dead file; - need to iterate here, too diff --git a/sch2fig/git-file.c b/sch2fig/git-file.c index 6b883c3..9e0cb0f 100644 --- a/sch2fig/git-file.c +++ b/sch2fig/git-file.c @@ -37,10 +37,12 @@ static git_repository *select_repo(const char *path) * So we trim off elements until we find a repository. */ while (1) { + if (verbose > 2) + fprintf(stderr, "trying \"%s\"\n", tmp); if (!git_repository_open_ext(&repo, *tmp ? tmp : "/", GIT_REPOSITORY_OPEN_CROSS_FS, NULL)) break; - slash = strrchr(path, '/'); + slash = strrchr(tmp, '/'); if (!slash) break; *slash = 0;