From: Tobias Ulmer Date: Fri, 17 May 2019 14:01:48 +0000 (+0200) Subject: git: work around git archive picking up information from CWD X-Git-Tag: e2factory-2.3.18rc3~3 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=0a5caca48ba206b5f6c6f7cce58073a56b8e9bf2;p=e2factory.git git: work around git archive picking up information from CWD Signed-off-by: Tobias Ulmer --- 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