Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
    npro  
 Modern all-safe Rust Network Protocol library supporting h1, h2, h3, ws, wt sans-IO and with socket IO + tls
git clone https://npro.rs/repo/npro
 
root / src / power / p-ws-server.c
Author[]google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.c...> 2025-08-17 15:53 UTC
Committer[]Andy Green <andy@warmcat.com> 2025-08-17 15:55 UTC
Treed813967b5baeb2b012fdeb74c9c3b18906da976f   Raw Patch
 
Fix git fetch loop in sai-builder
Fix git fetch loop in sai-builder

The git helper script in the builder was using a refspec that could
fail when the provided ref was a hash, or when the hash was not the
tip of the branch. This caused the script to fail, and the builder to
enter an infinite retry loop, consuming CPU.

The script is modified to separate the fetching of the git object
from the creation of the local ref. It now fetches the provided ref
or hash, and then explicitly creates a local ref `ref-<hash>` pointing
to the specific commit hash. This makes the process more robust and
prevents the retry loop.
diff --git a/src/builder/b-mirror.c b/src/builder/b-mirror.c index f98e429..05bb29a 100644 --- a/src/builder/b-mirror.c +++ b/src/builder/b-mirror.c @@ -57,8 +57,12 @@ static const char * const git_helper_sh = " if [ ! -d \"$MIRROR_PATH/.git\" ]; then\n" " git init --bare \"$MIRROR_PATH\"\n" " fi\n" - " REFSPEC=\"$REF:ref-$HASH\"\n" - " git -C \"$MIRROR_PATH\" fetch \"$REMOTE_URL\" \"$REFSPEC\"\n" + " if [ \"$REF\" != \"$HASH\" ]; then\n" + " git -C \"$MIRROR_PATH\" fetch \"$REMOTE_URL\" \"$REF\"\n" + " else\n" + " git -C \"$MIRROR_PATH\" fetch \"$REMOTE_URL\" \"$HASH\"\n" + " fi\n" + " git -C \"$MIRROR_PATH\" update-ref \"ref-$HASH\" \"$HASH\"\n" "elif [ \"$OPERATION\" == \"checkout\" ]; then\n" " MIRROR_PATH=$1\n" " BUILD_DIR=$2\n"
Page fetched 0s ago, creation time: 5ms (vhost etag hits: 0%, cache hits: 0%)