fix(builder): refresh git index before publish gate
This commit is contained in:
@@ -75,6 +75,8 @@ if [[ -z "$dest" && -z "${COPY_SCRIPT:-}" || $# -eq 0 ]]; then
|
||||
fi
|
||||
|
||||
if [[ -n "$project_root" ]] && git -C "$project_root" rev-parse HEAD >/dev/null 2>&1; then
|
||||
# Refresh Git's cached stat data after build tools rewrite tracked files.
|
||||
git -C "$project_root" update-index -q --refresh 2>/dev/null || true
|
||||
if [[ ${ALLOW_UNCOMMITTED:-0} != 1 ]] && ! git -C "$project_root" diff-index --quiet HEAD -- 2>/dev/null; then
|
||||
echo "Error: working tree has uncommitted changes; refusing to publish." >&2
|
||||
echo "Commit first, or set ALLOW_UNCOMMITTED=1 to publish anyway." >&2
|
||||
|
||||
Reference in New Issue
Block a user