Use environment variable for git author in tests

This way it doesn't have to be repeated every time.
This commit is contained in:
Alyssa Ross 2021-08-02 09:55:35 +00:00 committed by Cole Helbling
parent 02396b2a1b
commit 4a56d518c9
2 changed files with 8 additions and 4 deletions

View file

@ -6,6 +6,8 @@ co=$2
export GIT_CONFIG_GLOBAL=/dev/null export GIT_CONFIG_GLOBAL=/dev/null
export GIT_CONFIG_NOSYSTEM=1 export GIT_CONFIG_NOSYSTEM=1
export GIT_AUTHOR_NAME="GrahamCOfBorg"
export GIT_AUTHOR_EMAIL="graham+cofborg@example.com"
makepr() { makepr() {
git init --bare "$bare" git init --bare "$bare"
@ -13,13 +15,13 @@ makepr() {
cp -r maintainers/* "$co/" cp -r maintainers/* "$co/"
git -C "$co" add . git -C "$co" add .
git -C "$co" commit --author "GrahamCOfBorg <graham+cofborg@example.com>" -m "initial repo commit" git -C "$co" commit -m "initial repo commit"
git -C "$co" push origin master git -C "$co" push origin master
cp maintainers-pr/* "$co/" cp maintainers-pr/* "$co/"
git -C "$co" checkout -b my-cool-pr git -C "$co" checkout -b my-cool-pr
git -C "$co" add . git -C "$co" add .
git -C "$co" commit --author "GrahamCOfBorg <graham+cofborg@example.com>" -m "check out this cool PR" git -C "$co" commit -m "check out this cool PR"
git -C "$co" push origin my-cool-pr:refs/pull/1/head git -C "$co" push origin my-cool-pr:refs/pull/1/head
} }

View file

@ -6,6 +6,8 @@ co=$2
export GIT_CONFIG_GLOBAL=/dev/null export GIT_CONFIG_GLOBAL=/dev/null
export GIT_CONFIG_NOSYSTEM=1 export GIT_CONFIG_NOSYSTEM=1
export GIT_AUTHOR_NAME="GrahamCOfBorg"
export GIT_AUTHOR_EMAIL="graham+cofborg@example.com"
makepr() { makepr() {
git init --bare "$bare" git init --bare "$bare"
@ -13,13 +15,13 @@ makepr() {
cp build/* "$co/" cp build/* "$co/"
git -C "$co" add . git -C "$co" add .
git -C "$co" commit --author "GrahamCOfBorg <graham+cofborg@example.com>" -m "initial repo commit" git -C "$co" commit -m "initial repo commit"
git -C "$co" push origin master git -C "$co" push origin master
cp build-pr/* "$co/" cp build-pr/* "$co/"
git -C "$co" checkout -b my-cool-pr git -C "$co" checkout -b my-cool-pr
git -C "$co" add . git -C "$co" add .
git -C "$co" commit --author "GrahamCOfBorg <graham+cofborg@example.com>" -m "check out this cool PR" git -C "$co" commit -m "check out this cool PR"
git -C "$co" push origin my-cool-pr:refs/pull/1/head git -C "$co" push origin my-cool-pr:refs/pull/1/head
} }