HEX
Server: Apache/2.4.65 (Ubuntu)
System: Linux ielts-store-v2 6.8.0-1036-gcp #38~22.04.1-Ubuntu SMP Thu Aug 14 01:19:18 UTC 2025 x86_64
User: root (0)
PHP: 7.2.34-54+ubuntu20.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: //snap/google-cloud-cli/394/platform/gsutil/third_party/mock/tools/applypatch-transform
#!/bin/sh
#
# An example hook script to transform a patch taken from an email
# by git am.
#
# The hook should exit with non-zero status after issuing an
# appropriate message if it wants to stop the commit.  The hook is
# allowed to edit the patch file.
#
# To enable this hook, rename this file to "applypatch-transform".
#
# This example changes the path of Lib/unittest/mock.py to mock.py
# Lib/unittest/tests/testmock to tests and Misc/NEWS to NEWS, and
# finally skips any patches that did not alter mock.py or its tests.

set -eux

patch_path=$1

# Pull out mock.py
filterdiff --clean --strip 3 --addprefix=a/mock/ -i 'a/Lib/unittest/mock.py' -i 'b/Lib/unittest/mock.py' $patch_path > $patch_path.mock
# And the tests
filterdiff --clean --strip 5 --addprefix=a/mock/tests/ -i 'a/Lib/unittest/test/testmock/*.py' -i 'b/Lib/unittest/test/testmock/*.py' $patch_path > $patch_path.tests
# Lastly we want to pick up any NEWS entries.
filterdiff --strip 2 --addprefix=a/ -i a/Misc/NEWS -i b/Misc/NEWS $patch_path > $patch_path.NEWS
cp $patch_path $patch_path.orig
# bash
cat $patch_path.mock $patch_path.tests > $patch_path
filtered=$(cat $patch_path)
if [ -n "${filtered}" ]; then
  cat $patch_path.NEWS >> $patch_path
  exitcode=0
else
  exitcode=1
fi

rm $patch_path.mock $patch_path.tests $patch_path.NEWS
exit $exitcode