[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/11: git-download: Don't assume the working directory is the parent of
From: |
Marius Bakke |
Subject: |
01/11: git-download: Don't assume the working directory is the parent of ".git". |
Date: |
Tue, 25 Sep 2018 18:40:20 -0400 (EDT) |
mbakke pushed a commit to branch master
in repository guix.
commit 280fc8351230a8fea086d9bbce919ba8395f312c
Author: Marius Bakke <address@hidden>
Date: Sat Sep 15 11:53:40 2018 +0200
git-download: Don't assume the working directory is the parent of ".git".
This makes it do the right thing w.r.t. git worktrees.
* guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY to
locate checkout. Rename from "top" to "workdir".
---
guix/git-download.scm | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/guix/git-download.scm b/guix/git-download.scm
index 24cf11b..fa94fad 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))))
- branch master updated (88268a3 -> 3b97a17), Marius Bakke, 2018/09/25
- 03/11: gnu: enchant: Don't build libenchant.a., Marius Bakke, 2018/09/25
- 01/11: git-download: Don't assume the working directory is the parent of ".git".,
Marius Bakke <=
- 02/11: gnu: enchant: Update home page., Marius Bakke, 2018/09/25
- 08/11: gnu: node: Delete expired tests., Marius Bakke, 2018/09/25
- 04/11: gnu: enchant: Propagate Glib., Marius Bakke, 2018/09/25
- 09/11: gnu: Add Node LTS., Marius Bakke, 2018/09/25
- 06/11: gnu: gspell: Update to 1.8.1., Marius Bakke, 2018/09/25
- 05/11: gnu: enchant: Update to 2.2.3., Marius Bakke, 2018/09/25
- 07/11: gnu: webkitgtk: Remove obsolete phase., Marius Bakke, 2018/09/25
- 10/11: gnu: varnish: Use absolute file name of "rm"., Marius Bakke, 2018/09/25
- 11/11: services: Add Varnish service., Marius Bakke, 2018/09/25