From 0a5caca48ba206b5f6c6f7cce58073a56b8e9bf2 Mon Sep 17 00:00:00 2001 From: Tobias Ulmer Date: Fri, 17 May 2019 16:01:48 +0200 Subject: [PATCH] git: work around git archive picking up information from CWD Signed-off-by: Tobias Ulmer --- plugins/git.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/git.lua b/plugins/git.lua index 5d62da8..3839559 100644 --- a/plugins/git.lua +++ b/plugins/git.lua @@ -678,11 +678,9 @@ function git.git_source:prepare_source(sourceset, buildpath) end if sourceset == "working-copy" then - local empty + local empty = true srcdir = e2lib.join(e2tool.root(), self:get_working()) - - empty = true for f, re in e2lib.directory(srcdir, true) do if not f then return false, e:cat(re) @@ -776,7 +774,11 @@ function git.git_source:prepare_source(sourceset, buildpath) { istype = "writefunc", dup = eio.STDERR, linebuffer = true, callfn = log_git }, } - pid, re = e2lib.callcmd(git_argv, git_fdctv, nil, nil, 'nopoll') + -- Unfortunately git archive seems to pick up information from the CWD git + -- repository despite --git-dir etc. + -- Always force workdir to the project root. If this causes an issue it + -- will at least not depend on the location of the CWD of e2-build + pid, re = e2lib.callcmd(git_argv, git_fdctv, e2tool.root(), nil, 'nopoll') if not pid then return false, e:cat(re) end -- 2.39.5