diff options
author | Tom Willemse | 2014-03-01 21:07:22 +0100 |
---|---|---|
committer | Tom Willemse | 2014-03-01 21:18:39 +0100 |
commit | dba15ac9904725795f1ec8d8d11dabfe843557ff (patch) | |
tree | e590f9672dd9986dcafdafcb734fdde8721797c1 | |
parent | aacc242fb3707ac5ff2b01d345a9ac709243d624 (diff) | |
download | gitto-dba15ac9904725795f1ec8d8d11dabfe843557ff.tar.gz gitto-dba15ac9904725795f1ec8d8d11dabfe843557ff.zip |
Promote hookwrapper to procedure
-rw-r--r-- | gitto/main.scm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gitto/main.scm b/gitto/main.scm index 5b288de..212f5dc 100644 --- a/gitto/main.scm +++ b/gitto/main.scm @@ -46,6 +46,11 @@ (for-each print-repository-location (sort repositories repository-location<?))) +(define (maybe-install-hooks. repo) + "Install hooks for REPO unless it's excluded." + (unless (member (repo-name repo) config-exclusion-list) + (install-hooks (repo-location repo)))) + (define (print-config repo) "Print the configuration for REPO." (display (string-upcase (repo-name repo))) @@ -195,15 +200,11 @@ Installs the configured hooks into each repository or the given repository." (cond ((equal? sub "init") - (let ((hookwrapper - (lambda (r) - (unless (member (repo-name r) config-exclusion-list) - (install-hooks (repo-location r)))))) - (if repository - (if (known? repository) - (hookwrapper (make <repository> repository)) - (format #t "Unknown repository: ~a~%" repository)) - (for-each hookwrapper repositories)))))) + (if repository + (if (known? repository) + (maybe-install-hooks. (make <repository> repository)) + (format #t "Unknown repository: ~a~%" repository)) + (for-each maybe-install-hooks. repositories))))) (define-command (list . args) "List information about every repository." |