Fix provision-ringtail ls-remote matching with mirror refs
git ls-remote returns multiple lines when a mirror ref exists (e.g. refs/remotes/remote_mirror_*/main). Take only the first line to avoid a false mismatch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
918df9e642
commit
1f2134bf0a
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ if ! git diff --quiet nixos/ringtail/flake.lock; then
|
|||
fi
|
||||
|
||||
COMMIT=$(git rev-parse HEAD)
|
||||
REMOTE_REF=$(git ls-remote origin "$(git rev-parse --abbrev-ref HEAD)" 2>/dev/null | awk '{print $1}')
|
||||
REMOTE_REF=$(git ls-remote origin "$(git rev-parse --abbrev-ref HEAD)" 2>/dev/null | awk 'NR==1{print $1}')
|
||||
|
||||
if [[ "$REMOTE_REF" != "$COMMIT" ]]; then
|
||||
echo "ERROR: Current commit $COMMIT is not pushed to forge."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue