3Z4LPN - fix devcpone sync agar semua commit ter-push ikut tersync

This commit is contained in:
sas.fajri
2026-06-24 11:47:39 +07:00
parent a4e4f46088
commit 8c6068bb9f
2 changed files with 8 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ while read -r local_ref local_sha remote_ref remote_sha; do
esac
repo_root=$(git rev-parse --show-toplevel)
if ! "$repo_root/scripts/devcpone_sync.sh" "$branch"; then
if ! "$repo_root/scripts/devcpone_sync.sh" "$branch" "$remote_sha" "$local_sha"; then
printf '%s\n' "devcpone sync failed; blocking push" >&2
exit 1
fi

View File

@@ -3,6 +3,8 @@ set -eu
repo_root=$(git rev-parse --show-toplevel)
branch=${1:-$(git symbolic-ref --quiet --short HEAD 2>/dev/null || true)}
old_sha=${2:-}
new_sha=${3:-HEAD}
case "$branch" in
master)
@@ -22,8 +24,11 @@ trap 'rm -rf "$tmpdir"' EXIT HUP INT TERM
manifest="$tmpdir/files.list"
verify_list="$tmpdir/files.verify"
if git rev-parse --verify HEAD^ >/dev/null 2>&1; then
git diff -M --name-only -z --diff-filter=ACMR HEAD^ HEAD > "$manifest"
zero_sha="0000000000000000000000000000000000000000"
if [ -n "$old_sha" ] && [ "$old_sha" != "$zero_sha" ]; then
git diff -M --name-only -z --diff-filter=ACMR "$old_sha" "$new_sha" > "$manifest"
elif git rev-parse --verify "${new_sha}^" >/dev/null 2>&1; then
git diff -M --name-only -z --diff-filter=ACMR "${new_sha}^" "$new_sha" > "$manifest"
else
git ls-files -z > "$manifest"
fi