summaryrefslogtreecommitdiff
path: root/guix/git-download.scm
diff options
context:
space:
mode:
authorJan Nieuwenhuizen <janneke@gnu.org>2018-10-21 23:18:19 +0200
committerJan Nieuwenhuizen <janneke@gnu.org>2018-10-21 23:19:35 +0200
commitcf7658f7cb5de0e17f4801faa84c378a4b40033e (patch)
tree646fa120d67bb41868a543461700e62aa170b2c0 /guix/git-download.scm
parent09c5a5680a06011f985a84aa26fb890b3be453bd (diff)
parentffddb42d6c510456997ee6de1c1b8026c9ce6d14 (diff)
Merge branch 'core-updates' into core-updates-next
Diffstat (limited to 'guix/git-download.scm')
-rw-r--r--guix/git-download.scm15
1 files changed, 8 insertions, 7 deletions
diff --git a/guix/git-download.scm b/guix/git-download.scm
index 24cf11be5e..fa94fad8f8 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -156,22 +156,23 @@ HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if #f."
The result is similar to that of the 'git ls-files' command, except that it
also includes directories, not just regular files. The returned file names
are relative to DIRECTORY, which is not necessarily the root of the checkout."
- (let* ((directory (canonicalize-path directory))
+ (let* (;; 'repository-working-directory' always returns a trailing "/",
+ ;; so add one here to ease the comparisons below.
+ (directory (string-append (canonicalize-path directory) "/"))
(dot-git (repository-discover directory))
- (top (dirname dot-git))
(repository (repository-open dot-git))
+ ;; XXX: This procedure is mistakenly private in Guile-Git 0.1.0.
+ (workdir ((@@ (git repository) repository-working-directory)
+ repository))
(head (repository-head repository))
(oid (reference-target head))
(commit (commit-lookup repository oid))
(tree (commit-tree commit))
(files (tree-list tree)))
(repository-close! repository)
- (if (string=? top directory)
+ (if (string=? workdir directory)
files
- (let ((relative (string-append
- (string-drop directory
- (+ 1 (string-length top)))
- "/")))
+ (let ((relative (string-drop directory (string-length workdir))))
(filter-map (lambda (file)
(and (string-prefix? relative file)
(string-drop file (string-length relative))))