git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[BUG] Clones from local repositories do not work correctly under Windows

From
LSL. E. Segovia <amy@amyspark.me>
Date
Apr 11, 2024, 17:03 UTC
Message-ID
<44020a6a-707f-4505-adde-e79cda63d711@amyspark.me>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Under Windows 10 21H2, I cloned a Git repository off an existing local copy, then applied a patch to it using `git am`.

What did you expect to happen? (Expected behavior)

Operations on the repo like `git status` and `git log` should work out of the box.

What happened instead? (Actual behavior)
I keep getting this error:
> error: unable to normalize alternate object path:
/c/Users/Amalia/.cache/cerbero-sources/librsvg-2.40.20/.git/objects

With `git status` it happens only once, but with `git log` it's a wall worth of that error before the log is actually generated and paged.

This error makes Git complain, but tools depending on it (in particular Cargo) outright crash. For instance, this is the error I got when attempting to build the Rust crate above:

> Error: CliError { error: Some(failed to determine package fingerprint

for build script for librsvg v2.58.0-beta.1 (E:\cerbero\build\sources\msvc_x86_64\librsvg-2.40.20\rsvg)

>
> Caused by:
>     0: failed to determine the most recently modified file in
E:\cerbero\build\sources\msvc_x86_64\librsvg-2.40.20\rsvg
>     1: failed to determine list of files in
E:\cerbero\build\sources\msvc_x86_64\librsvg-2.40.20\rsvg
>     2: object not found - no match for id

(32467a0191907fd571b502e395d033a06dfee655); class=Odb (9); code=NotFound (-3)), exit_code: 101 }

What's different between what you expected and what actually happened?

It seems that under Windows, the code in https://github.com/git/git/blame/436d4e5b14df49870a897f64fe92c0ddc7017e4c/object-file.c#L525 is not able to resolve the absolute path of the "remote" (the original copy) at all. I checked if it was a filesystem traversal issue by issuing the clone against a folder in the same drive, but there was no change.

Anything else you want to add:

Possibly introduced in 2.39.0: https://github.com/git/git/commit/199337d6ec5c656e52b914b5dac3820cc5e363f3

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.44.0.windows.1 cpu: x86_64 built from commit: ad0bbfffa543db6979717be96df630d3e5741331 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Windows 10.0 19045 compiler info: gnuc: 13.2 libc info: no libc information available $SHELL (typically, interactive shell): <unset>

[Enabled Hooks]
-- 
amyspark 🌸 https://www.amyspark.me
Next: Johannes Sixt
Message 1 of 9 in “[BUG] Clones from local repositories do not work correctly under Windows”
  1. L. E. SegoviaApr 11, 2024
  2. Johannes SixtApr 12, 2024
  3. L. E. SegoviaApr 12, 2024
  4. Johannes SixtApr 12, 2024
  5. L. E. SegoviaApr 12, 2024
  6. Junio C HamanoApr 12, 2024
  7. rsbecker@nexbridge.comApr 12, 2024
  8. L. E. SegoviaApr 12, 2024
  9. Johannes SixtApr 12, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.