diff options
author | 2008-02-27 21:42:10 +0100 | |
---|---|---|
committer | 2008-02-27 21:42:10 +0100 | |
commit | 227bc9cea1984b89b848b1b2a244695a12189f9e (patch) | |
tree | 0433a78d01718d67b711661e12c2d770c3abdfb7 /tekuti/git.scm | |
parent | bc57e2a655fac45eb3ad14792513d2a516aff9c5 (diff) | |
download | tekuti-227bc9cea1984b89b848b1b2a244695a12189f9e.tar.gz tekuti-227bc9cea1984b89b848b1b2a244695a12189f9e.zip |
incremental reindexing, import charset fixes, other thingies
Diffstat (limited to 'tekuti/git.scm')
-rw-r--r-- | tekuti/git.scm | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tekuti/git.scm b/tekuti/git.scm index aede954..355d3b1 100644 --- a/tekuti/git.scm +++ b/tekuti/git.scm @@ -39,7 +39,7 @@ git git* ensure-git-repo git-ls-tree git-ls-subdirs parse-metadata parse-commit commit-utc-timestamp commit-parents make-tree git-rev-parse make-tree-full - create-blob + create-blob git-update-ref write-indices read-indices)) @@ -63,7 +63,7 @@ (string->list str)) (display #\')))) -(define *debug* #t) +(define *debug* #f) (define (trc . args) (if *debug* (apply pk args) @@ -88,7 +88,8 @@ (ret (close-pipe pipe))) (case (status:exit-val ret) ((0) (if (eof-object? output) "" output)) - (else (raise (condition (&git-condition + (else (trc 'git-error output ret real-args) + (raise (condition (&git-condition (argv real-args) (output output) (status ret)))))))) @@ -211,6 +212,19 @@ alist) "\n" 'suffix)))) +(define (git-update-ref refname proc count) + (let* ((ref (git-rev-parse refname)) + (commit (proc ref))) + (cond + ((zero? count) + (error "my god, we looped 5 times" commit)) + ((false-if-git-error + (git "update-ref" refname commit ref)) + commit) + (else + (pk "failed to update the ref, trying again..." refname) + (git-update-ref (git-rev-parse refname) (1- count)))))) + ;; fixme: map-pairs (define (assoc-list-ref alist key n default) |