From e72c0930573377c52b41bcb45b40d270cbbe8cc4 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sat, 1 Mar 2014 20:00:02 +0100 Subject: [PATCH] Split known? into a couple of functions --- gitto/main.scm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/gitto/main.scm b/gitto/main.scm index 6459cd5..2600c88 100644 --- a/gitto/main.scm +++ b/gitto/main.scm @@ -58,14 +58,21 @@ Displays version and some copyright information." (display "under the terms of the GNU General Public License.") (newline) (display "For more information about these matters, see the file named COPYING.") (newline)) +(define (registered? repo) + "Check if REPO has been registered." + (or (member repo repositories same-repository?) + (member (realpath (if (string? repo) + repo + (repo-location repo))) + repositories same-repository?))) + +(define (valid-repo? repo) + "Check if REPO is or could be made usable as a repository." + (or (repository? repo) (string? repo))) + (define (known? repo) "Do we know REPO?" - (and (or (repository? repo) (string? repo)) - (or (member repo repositories same-repository?) - (member (realpath (if (string? repo) - repo - (repo-location repo))) - repositories same-repository?)))) + (and (valid-repo? repo) (registered? repo))) (define (save-repositories-list) "Save the list of repositories."