diff --git a/gitto/git.scm b/gitto/git.scm index 83674be..be91042 100644 --- a/gitto/git.scm +++ b/gitto/git.scm @@ -36,6 +36,7 @@ repo-clean? repo-location repo-name + repository? same-repository?)) (define show-unchanged-branches? #f) @@ -55,6 +56,9 @@ (clean? #:getter repo-clean?) (branches #:getter repo-branches)) +(define (repository? repo) + (is-a? repo )) + (define-method (branch-pullable (branch )) (force (slot-ref branch 'pullable))) @@ -180,6 +184,9 @@ REPO should be of type `' and the result is a string." (define-method (same-repository? (x ) (y )) (string= x (repo-location y))) +(define-method (same-repository? x y) + #f) + (define* (start-git dir args #:optional (extra "")) (open-input-pipe (format #f "git --work-tree=~s --git-dir=\"~a/.git\" ~a 2>/dev/null ~a" diff --git a/gitto/main.scm b/gitto/main.scm index 3c82e49..7ccfb34 100644 --- a/gitto/main.scm +++ b/gitto/main.scm @@ -100,9 +100,12 @@ COMMAND." (define (known? repo) "Do we know REPO?" - (or (member repo repositories same-repository?) - (member (realpath (if (string? repo) repo (repo-location repo))) - repositories same-repository?))) + (and (or (repository? repo) (string? repo)) + (or (member repo repositories same-repository?) + (member (realpath (if (string? repo) + repo + (repo-location repo))) + repositories same-repository?)))) (define (save-repositories-list) "Save the list of repositories."