Changeset View
Changeset View
Standalone View
Standalone View
contrib/source-control-tools/test/test-autopatch.sh
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | final_cleanup() { | ||||
echo "${0}:" | echo "${0}:" | ||||
echo "${TEST_STATUS}" | echo "${TEST_STATUS}" | ||||
} | } | ||||
TEMP_DIR=$(mktemp -d) | TEMP_DIR=$(mktemp -d) | ||||
trap 'final_cleanup ${TEMP_DIR}' RETURN EXIT | trap 'final_cleanup ${TEMP_DIR}' RETURN EXIT | ||||
cd "${TEMP_DIR}" | cd "${TEMP_DIR}" | ||||
git init | git init | ||||
# Set a temporary git config in case a global config isn't set | |||||
git config user.name "test-autopatch" | |||||
git config user.email "test@test.test" | |||||
git remote add testorigin "${TOPLEVEL}" | git remote add testorigin "${TOPLEVEL}" | ||||
git pull testorigin "${REMOTE_AND_BRANCH}" | git pull testorigin "${REMOTE_AND_BRANCH}" | ||||
test_cleanup() { | test_cleanup() { | ||||
# Cleanup current branch so that arcanist doesn't run out of branch names | # Cleanup current branch so that arcanist doesn't run out of branch names | ||||
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||||
git checkout "${MASTER_BRANCH}" | git checkout "${MASTER_BRANCH}" | ||||
git reset --hard HEAD | git reset --hard HEAD | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |