Support repositories without .git extension
gitile/handler.scm
121 | 121 | (show content #:code 500)) | |
122 | 122 | (define (get-repo name) | |
123 | 123 | (let ((repo (string-append (config-repositories config) | |
124 | - | "/" name ".git"))) | |
125 | - | (pk 'repo repo) | |
126 | - | (pk 'exists (file-exists? (string-append repo "/git-daemon-export-ok"))) | |
127 | - | (if (file-exists? (string-append repo "/git-daemon-export-ok")) | |
128 | - | (repository-open repo) | |
129 | - | #f))) | |
124 | + | "/" name ".git")) | |
125 | + | (repo2 (string-append (config-repositories config) | |
126 | + | "/" name))) | |
127 | + | (cond | |
128 | + | ((file-exists? (string-append repo "/git-daemon-export-ok")) | |
129 | + | (repository-open repo)) | |
130 | + | ((file-exists? (string-append repo2 "/git-daemon-export-ok")) | |
131 | + | (repository-open repo2)) | |
132 | + | (else #f)))) | |
130 | 133 | ||
131 | 134 | (let ((repo (get-repo project-name))) | |
132 | 135 | (if repo | |
… | |||
157 | 160 | res | |
158 | 161 | (if (and | |
159 | 162 | (> (string-length repo) 4) | |
160 | - | (equal? (substring repo (- (string-length repo) 4)) ".git") | |
163 | + | (file-exists? (string-append (config-repositories config) | |
164 | + | "/" repo "/.git")) | |
161 | 165 | (file-exists? (string-append (config-repositories config) | |
162 | 166 | "/" repo "/git-daemon-export-ok"))) | |
163 | 167 | (loop | |
164 | 168 | (cons | |
165 | - | (name->project (substring repo 0 (- (string-length repo) 4))) | |
169 | + | (name->project | |
170 | + | (if (equal? (substring repo (- (string-length repo) 4)) ".git") | |
171 | + | (substring repo 0 (- (string-length repo) 4)) | |
172 | + | repo)) | |
166 | 173 | res) | |
167 | 174 | (readdir dir)) | |
168 | 175 | (loop res (readdir dir))))))) |