aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMathieu Othacehe <m.othacehe@gmail.com>2017-06-10 12:32:59 +0200
committerMathieu Othacehe <m.othacehe@gmail.com>2017-07-01 18:47:18 +0200
commit706c80c6a0e0ab32684d4ae9d8d11295bb70087a (patch)
tree73705ecc754d6d8badece3fdc353c3c1cb0cdb20 /src
parent8f32507d1c8096e03eed103054f735b35d803e37 (diff)
downloadcuirass-706c80c6a0e0ab32684d4ae9d8d11295bb70087a.tar
cuirass-706c80c6a0e0ab32684d4ae9d8d11295bb70087a.tar.gz
repo: remove git-repo.
* src/cuirass/repo.scm (git-repo): Remove it. * tests/repo.scm: Remove related tests. git-repo is not used and it's usecases will be covered by (guix git).
Diffstat (limited to 'src')
-rw-r--r--src/cuirass/repo.scm38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/cuirass/repo.scm b/src/cuirass/repo.scm
index be5ea5b..26ea328 100644
--- a/src/cuirass/repo.scm
+++ b/src/cuirass/repo.scm
@@ -30,8 +30,7 @@
repo-snapshot
repo-updater
repo-update
- file-repo
- git-repo))
+ file-repo))
(define-immutable-record-type <repo>
;; An Abstract repository. Use "repo" as a shortname for "repository".
@@ -79,38 +78,3 @@
#:location file-name
#:snapshoter file-repo-snapshot
#:updater file-repo-update))))
-
-(define git-repo
- (let ((git "git")
- (hash-algo "sha256"))
- (define (git-repo-snapshot this store)
- "Add a snapshot of URL to STORE. "
- (let ((dir (repo-location this))
- (id (repo-id this)))
- (call-with-temporary-directory
- (λ (tmpdir)
- (let ((tmp-repo (string-append tmpdir "/" dir)))
- (and (zero? (system* "cp" "-R" dir tmpdir))
- (with-directory-excursion tmp-repo
- (zero? (system* "rm" "-rf" ".git")))
- (add-to-store store id #t hash-algo tmp-repo)))))))
-
- (define (git-repo-update this ref)
- (let ((url (repo-url this))
- (dir (repo-location this)))
- (and
- (or (file-exists? dir)
- (zero? (system* git "clone" url dir))
- (error "file not found"))
- (with-directory-excursion dir
- (and (zero? (system* git "pull"))
- (zero? (system* git "reset" "--hard" ref)))))))
-
- (λ* (#:key url dir)
- "Create a Git repository. URL is the location of the remote repository.
-REF is the identifier that is tracked."
- (repo #:id dir
- #:url url
- #:location dir
- #:snapshoter git-repo-snapshot
- #:updater git-repo-update))))