aboutsummaryrefslogtreecommitdiff
path: root/src/data
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-24 17:07:54 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-24 17:07:54 -0700
commite5221bf896e49f36cf7593cc6c1e0ac8a7319c01 (patch)
treef4e300a79349ff6166deb8afd1d6616f07316364 /src/data
parent0757caa94c359a475ab39ff35a7e1cf92bda5cdc (diff)
downloadconsfigurator-e5221bf896e49f36cf7593cc6c1e0ac8a7319c01.tar.gz
use the snapshot name as name for toplevel dir in DATA:GIT-SNAPSHOT
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/data')
-rw-r--r--src/data/git-snapshot.lisp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/data/git-snapshot.lisp b/src/data/git-snapshot.lisp
index d331c14..3a448c8 100644
--- a/src/data/git-snapshot.lisp
+++ b/src/data/git-snapshot.lisp
@@ -62,7 +62,7 @@ copy of the working tree over there."
(mapc #'delete-file
(directory-files
(pathname-directory-pathname path))))
- (make-snapshot repo depth branch path)
+ (make-snapshot name repo depth branch path)
(setq cached-commit tip
cached (make-instance 'file-data
:file path
@@ -72,10 +72,9 @@ copy of the working tree over there."
:version version)))))))
(cons #'check #'extract))))
-(defun make-snapshot (repo depth branch output)
+(defun make-snapshot (name repo depth branch output)
(with-local-temporary-directory (dir)
- (let* ((shortname (lastcar (pathname-directory repo)))
- (loc (ensure-directory-pathname (merge-pathnames shortname dir))))
+ (let ((loc (ensure-directory-pathname (merge-pathnames name dir))))
(run-program `("git" "clone"
"--no-hardlinks"
,@(and depth `("--depth" ,(write-to-string depth)))
@@ -88,7 +87,8 @@ copy of the working tree over there."
(delete-directory-tree (merge-pathnames ".git/refs/remotes/local/" loc)
:validate t :if-does-not-exist :ignore)
(with-current-directory (dir)
- (run-program `("tar" "cfz" ,(namestring output) ,shortname))))))
+ (run-program
+ `("tar" "cfz" ,(namestring output) ,(namestring name)))))))
(defun get-branch-tip (repo branch)
(with-current-directory (repo)