- (conc (if (equal? branch refname) "*" "")
- refname)
- (conc "browse-git.scm|tree|" repo "|" refname "|" path))))
- references)
- (list
- ""
- (conc "-----= Recent Commits [" branch "] =-----"))
- (map (lambda (commit)
- (list
- 1
- (conc (if (equal? branch commit) "*" "")
- (car (git "show" "-s" "--format=%s (%ar)" commit)))
- (conc "browse-git.scm|tree|" repo "|" commit "|" path)))
- commits)
- (list
- ""
- (conc "-----= Files [" path "] =-----"))
- (map (lambda (entry)
- (let* ((l (string-split entry "\t"))
- (type (string->symbol (cadr (string-split (car l) " "))))
- (file-path (cadr l))
- (file (conc (pathname-file file-path)
- (if (pathname-extension file-path)
- (conc "." (pathname-extension file-path))
- ""))))
- (list (if (eq? type 'tree) 1 0)
- file
- (conc "browse-git.scm|" type "|" repo "|" branch "|"
- file-path
- (if (eq? type 'tree) "/" "")))))
- entries))))
+ (conc (if (equal? branch commit) "*" "")
+ (car (git "show" "-s" "--format=%s (%ar)" commit)))
+ (conc "browse-git.scm|" repo "|" commit "|" path "|tree")))
+ commits)
+ (list ""
+ (conc "-----= Files [" path "] =-----"))
+ (map (lambda (entry)
+ (let* ((l (string-split entry "\t"))
+ (type (string->symbol (cadr (string-split (car l) " "))))
+ (file-path (cadr l))
+ (file (conc (pathname-file file-path)
+ (if (pathname-extension file-path)
+ (conc "." (pathname-extension file-path))
+ ""))))
+ (list (if (eq? type 'tree) 1 0)
+ file
+ (conc "browse-git.scm|" repo "|" branch "|"
+ file-path
+ (if (eq? type 'tree) "/" "")
+ "|" type))))
+ entries))))
+
+ (define (serve-blob)
+ (for-each
+ (lambda (line)
+ (print line "\r"))
+ (git "cat-file" "blob" (conc branch ":" path)))
+ (print ".\r"))