From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 15 06:10:52 2018 Received: (at submit) by debbugs.gnu.org; 15 Sep 2018 10:10:52 +0000 Received: from localhost ([127.0.0.1]:41128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g17XP-0001uc-O7 for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34694) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g17XN-0001uK-1N for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g17XH-0006EU-9L for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_20,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:49374) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g17XH-0006EL-4t for submit@debbugs.gnu.org; Sat, 15 Sep 2018 06:10:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g17XG-0005X1-AN for guix-patches@gnu.org; Sat, 15 Sep 2018 06:10:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g17XC-0005rf-B5 for guix-patches@gnu.org; Sat, 15 Sep 2018 06:10:42 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:48273) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g17XC-0005jV-3C for guix-patches@gnu.org; Sat, 15 Sep 2018 06:10:38 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 66EDB2188F for ; Sat, 15 Sep 2018 06:10:36 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 15 Sep 2018 06:10:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= content-transfer-encoding:date:from:message-id:mime-version :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=cgU1n3 ZkGwh3FFFf8cBXq3fOdyzKVI3OiDH1vDCcbyw=; b=fpTykbY1/m2E4/tX482MEg ZKpaaDJCsTRauqos3O5uAovO1/oNHq9wGbnWP+0GkML1a2YzOr3UZbgWcHAh+vhy bW7aatYDxRNQrRfMHBqgKOVkAmlMJIdaDEvBXLvfxJl+ZxAEoSGgSmE6hIbO7ej+ m0+iZE5MjL/9Mr2b2LtA3FY1fGom/IeBvkOqQ14G5qqYgpABKsI7IRHWRdSg5Sb4 +HVJInHmQIsrU748lFgoXAWYzrsy/6SlOsFETq/fivlUMSeKFzm5DVeyQSrjdspt gih+Ql9IMsW3qtQMKuuOCjhG1c+hzg07W4tC/y04eeDYuiV7A1pJW9zOicfRNRQA == DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=cgU1n3ZkGwh3FFFf8cBXq3fOdyzKVI3OiDH1vDCcb yw=; b=va042s9DKhFXHo6HU1LXXq+gDuH98MR8T4KM8IVdMob9ohtjermHY8bu1 Mf/fTrhpJiO0N3SgivztGxxuIQ+9digXX48l4gwP/+zR/087eFZ0eLyuW21/dKTd hqhE+yRB4tT3yhot7NeJY2AYGMbkXnIkKnLzrzYIfJ7qszM07Cj8CwhwkOgkRAHt fWCC01YqzGUeuj004Q7LxftRqRgqhfl8FP+kvryOIlqeiJbfgflMj8QQdSdHT7dX QdjCQsAy2UB/9BXTObTvaOlmsD/VrbW8WAzVh1xSn+PIrKc8N1O3fp3mtgGThes0 5Cv8WtXu7VLLdpyuUbXk9A9eNPSwA== X-ME-Proxy: X-ME-Sender: Received: from localhost (140.226.16.62.customer.cdi.no [62.16.226.140]) by mail.messagingengine.com (Postfix) with ESMTPA id A5A3C102D4 for ; Sat, 15 Sep 2018 06:10:35 -0400 (EDT) From: Marius Bakke To: guix-patches@gnu.org Subject: [PATCH] git-download: Don't assume the git checkout is the parent of ".git". Date: Sat, 15 Sep 2018 12:10:34 +0200 Message-Id: <20180915101034.10102-1-mbakke@fastmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.3 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.3 (-----) This makes it play nicely with worktrees. * guix/git-download.scm (git-file-list): Use REPOSITORY-WORKING-DIRECTORY to locate checkout. Rename from "top" to "workdir". --- Notes: Guix, This fixes (current-guix) for me in a worktree. Testing needed on other git setups! guix/git-download.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guix/git-download.scm b/guix/git-download.scm index 24cf11be5..a7c8173f4 100644 --- a/guix/git-download.scm +++ b/guix/git-download.scm @@ -158,19 +158,22 @@ 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)) (dot-git (repository-discover directory)) - (top (dirname dot-git)) (repository (repository-open dot-git)) + (workdir (canonicalize-path + ;; XXX: This variable is mistakenly private in Guile-Git 0.1.0. + ((@@ (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))) + (+ 1 (string-length workdir))) "/"))) (filter-map (lambda (file) (and (string-prefix? relative file) -- 2.19.0