aboutsummaryrefslogtreecommitdiffstats
path: root/gitto
diff options
context:
space:
mode:
authorGravatar Tom Willemse2014-03-01 21:17:53 +0100
committerGravatar Tom Willemse2014-03-01 21:18:39 +0100
commitbc4555b0ddc450df72a109f5117048aff42aeb61 (patch)
tree1991e8bd6cb5cb9d3c7293d3a579f967ca6100d2 /gitto
parentdba15ac9904725795f1ec8d8d11dabfe843557ff (diff)
downloadgitto-bc4555b0ddc450df72a109f5117048aff42aeb61.tar.gz
gitto-bc4555b0ddc450df72a109f5117048aff42aeb61.zip
Simplify purge command
Diffstat (limited to 'gitto')
-rw-r--r--gitto/git.scm5
-rw-r--r--gitto/main.scm5
2 files changed, 6 insertions, 4 deletions
diff --git a/gitto/git.scm b/gitto/git.scm
index c7b2cdf..3f760e2 100644
--- a/gitto/git.scm
+++ b/gitto/git.scm
@@ -38,6 +38,7 @@
repo-name
repository?
repository-location<?
+ repository-location-exists?
repository-name<?
same-repository?))
@@ -65,6 +66,10 @@
"Compary REPO1 and REPO2 to see if REPO1 should be considered less."
(string<? (repo-location repo1) (repo-location repo2)))
+(define (repository-location-exists? repo)
+ "Check to see if REPO's location exists."
+ (file-exists? (repo-location repo)))
+
(define (repository-name<? repo1 repo2)
"Compare REPO1 and REPO2 to see if REPO1 should be considered less."
(string<? (repo-name repo1) (repo-name repo2)))
diff --git a/gitto/main.scm b/gitto/main.scm
index 212f5dc..a46b5e2 100644
--- a/gitto/main.scm
+++ b/gitto/main.scm
@@ -228,10 +228,7 @@ registered repository as absolute paths."
Go through the list of registered repositories and remove all the ones
which no longer point to a git repository."
- (set! repositories
- (filter (lambda (repo)
- (file-exists? (repo-location repo)))
- repositories))
+ (set! repositories (filter repository-location-exists? repositories))
(save-repositories-list))
(define-command (remove repository)