aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gitto/git.scm5
-rw-r--r--gitto/main.scm13
2 files changed, 11 insertions, 7 deletions
diff --git a/gitto/git.scm b/gitto/git.scm
index be91042..a0cec3a 100644
--- a/gitto/git.scm
+++ b/gitto/git.scm
@@ -37,6 +37,7 @@
repo-location
repo-name
repository?
+ repository<?
same-repository?))
(define show-unchanged-branches? #f)
@@ -59,6 +60,10 @@
(define (repository? repo)
(is-a? repo <repository>))
+(define (repository<? repo1 repo2)
+ "Compary REPO1 and REPO2 to see if REPO1 should be considered smaller."
+ (string<? (repo-location repo1) (repo-location repo2)))
+
(define-method (branch-pullable (branch <branch>))
(force (slot-ref branch 'pullable)))
diff --git a/gitto/main.scm b/gitto/main.scm
index 0bd30a9..f8eeb18 100644
--- a/gitto/main.scm
+++ b/gitto/main.scm
@@ -43,13 +43,12 @@
(define (list-repository-locations)
"List the registered locations of repositories."
- (for-each
- (lambda (repo)
- (display (repo-location repo))
- (newline))
- (sort repositories
- (lambda (s1 s2)
- (string<? (repo-location s1) (repo-location s2))))))
+ (for-each print-repository-location (sort repositories repository<?)))
+
+(define (print-repository-location repo)
+ "Print the location of REPO."
+ (display (repo-location repo))
+ (newline))
(define (registered? repo)
"Check if REPO has been registered."