buildroot.busybox.net archive mirror
 help / color / mirror / Atom feed
* [Buildroot] [git commit] utils/docker-run: fix running when CWD is not MAIN_DIR
@ 2023-07-31 18:56 Yann E. MORIN
  2023-08-30 22:30 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2023-07-31 18:56 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=5b559109eeeec19e6e33c82712690aec89dcb562
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Commit 90790790925c (utils/docker-run: fix support for git-worktrees)
got last-minute changes when it was applied, and the case when the
current working directory is not the top of the current working copy
got broken.

Fix that by duplicating (and thus reinstating) the 'cd MAIN_DIR' to
match what is done when retrieving the git-common-dir.

Fixes: 90790790925c

Reported-by: Brandon Maier <Brandon.Maier@collins.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 utils/docker-run | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/utils/docker-run b/utils/docker-run
index b201d28289..ab95e61e84 100755
--- a/utils/docker-run
+++ b/utils/docker-run
@@ -27,9 +27,10 @@ declare -a docker_opts=(
 # .git directory.
 if [ "${GIT_DIR}" ]; then
     # GIT_DIR in the main working copy (when git supports worktrees) will
-    # be just '.git', but 'docker run' needs an absolute path. If it's an
-    # absolute path already (in a wordir), then that's a noop.
-    GIT_DIR="$(readlink -e "${GIT_DIR}")"
+    # be just '.git', but 'docker run' needs an absolute path. If it is
+    # not absolute, GIT_DIR is relative to MAIN_DIR. If it's an absolute
+    # path already (in a wordir), then that's a noop.
+    GIT_DIR="$(cd "${MAIN_DIR}"; readlink -e "${GIT_DIR}")"
     docker_opts+=( --mount "type=bind,src=${GIT_DIR},dst=${GIT_DIR}" )
 fi
 
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [git commit] utils/docker-run: fix running when CWD is not MAIN_DIR
  2023-07-31 18:56 [Buildroot] [git commit] utils/docker-run: fix running when CWD is not MAIN_DIR Yann E. MORIN
@ 2023-08-30 22:30 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2023-08-30 22:30 UTC (permalink / raw)
  To: Yann E. MORIN; +Cc: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > commit: https://git.buildroot.net/buildroot/commit/?id=5b559109eeeec19e6e33c82712690aec89dcb562
 > branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

 > Commit 90790790925c (utils/docker-run: fix support for git-worktrees)
 > got last-minute changes when it was applied, and the case when the
 > current working directory is not the top of the current working copy
 > got broken.

 > Fix that by duplicating (and thus reinstating) the 'cd MAIN_DIR' to
 > match what is done when retrieving the git-common-dir.

 > Fixes: 90790790925c

 > Reported-by: Brandon Maier <Brandon.Maier@collins.com>
 > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

Committed to 2023.02.x and 2023.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-30 22:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-31 18:56 [Buildroot] [git commit] utils/docker-run: fix running when CWD is not MAIN_DIR Yann E. MORIN
2023-08-30 22:30 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).