Yocto Project Documentation
 help / color / mirror / Atom feed
* [PATCH v1] fetch2/git: Fix trailing slash in clone command causing double slash in alternates
@ 2026-05-15  8:03 Jamin Lin
  2026-05-15  8:03 ` [PATCH] " Jamin Lin
  0 siblings, 1 reply; 2+ messages in thread
From: Jamin Lin @ 2026-05-15  8:03 UTC (permalink / raw)
  To: bitbake-devel@lists.openembedded.org
  Cc: docs@lists.yoctoproject.org, Troy Lee, Jamin Lin

The unpack() method constructs the git clone command with a trailing
slash appended to ud.clonedir:

  git clone -s <clonedir>/ <destdir>

When git processes 'clone -s', it writes the source object path into
<destdir>/.git/objects/info/alternates by appending '/objects' to the
source path. The extra trailing slash produces a double slash:

  <clonedir>//objects

Newer versions of git refuse to normalize this path and report:

 error: unable to normalize alternate object path: <path>//objects
  fatal: bad object HEAD

Remove the spurious trailing slash so the alternates file contains a
valid, normalizable path.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
 lib/bb/fetch2/git.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 01bebb764..b2b39549d 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -697,7 +697,7 @@ class Git(FetchMethod):
             if update and os.path.exists(destdir):
                 update_mode = True
             else:
-                runfetchcmd("%s clone %s %s/ %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d)
+                runfetchcmd("%s clone %s %s %s" % (ud.basecmd, ud.cloneflags, ud.clonedir, destdir), d)
             source_found = True
         else:
             source_error.append("clone directory not available or not up to date: " + ud.clonedir)
-- 
2.43.0


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

end of thread, other threads:[~2026-05-15  8:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-15  8:03 [PATCH v1] fetch2/git: Fix trailing slash in clone command causing double slash in alternates Jamin Lin
2026-05-15  8:03 ` [PATCH] " Jamin Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox