3Z4LPN - fix devcpone sync agar semua commit ter-push ikut tersync
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user