Fix some bugs

- The `register-repository' procedure was using a non-existent
  procedure `repository-name', this should be `repo-name'.

- The `purge' procedure was working on a collection of `<repository>'
  objects, but assuming they were file names, the `repo-location'
  should first be extracted before calling `file-exists?'.
This commit is contained in:
Tom Willemse 2013-05-12 15:03:00 +02:00
parent addf53abed
commit a3d1cc969f

View file

@ -169,7 +169,7 @@ gitto [options]
(set! repositories (append `(,repository) repositories))
(save-repositories-list)
(simple-format #t "Repository ~A registered."
(repository-name repository)))
(repo-name repository)))
(display "Repository already registered."))
(newline))
@ -250,7 +250,10 @@ to the tracked files. Utracked files will not register."
(define (purge)
"Purge all items from the list that can no longer be found."
(set! repositories (filter file-exists? repositories))
(set! repositories
(filter (lambda (repo)
(file-exists? (repo-location repo)))
repositories))
(save-repositories-list))
(define option-spec