From 4a56d518c9f52fc97f28a53b9f11392b27a88a21 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 2 Aug 2021 09:55:35 +0000 Subject: [PATCH] Use environment variable for git author in tests This way it doesn't have to be repeated every time. --- ofborg/test-srcs/make-maintainer-pr.sh | 6 ++++-- ofborg/test-srcs/make-pr.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ofborg/test-srcs/make-maintainer-pr.sh b/ofborg/test-srcs/make-maintainer-pr.sh index 08433d9..78bd76c 100755 --- a/ofborg/test-srcs/make-maintainer-pr.sh +++ b/ofborg/test-srcs/make-maintainer-pr.sh @@ -6,6 +6,8 @@ co=$2 export GIT_CONFIG_GLOBAL=/dev/null export GIT_CONFIG_NOSYSTEM=1 +export GIT_AUTHOR_NAME="GrahamCOfBorg" +export GIT_AUTHOR_EMAIL="graham+cofborg@example.com" makepr() { git init --bare "$bare" @@ -13,13 +15,13 @@ makepr() { cp -r maintainers/* "$co/" git -C "$co" add . - git -C "$co" commit --author "GrahamCOfBorg " -m "initial repo commit" + git -C "$co" commit -m "initial repo commit" git -C "$co" push origin master cp maintainers-pr/* "$co/" git -C "$co" checkout -b my-cool-pr git -C "$co" add . - git -C "$co" commit --author "GrahamCOfBorg " -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 } diff --git a/ofborg/test-srcs/make-pr.sh b/ofborg/test-srcs/make-pr.sh index 92e8ca7..cbe1fe1 100755 --- a/ofborg/test-srcs/make-pr.sh +++ b/ofborg/test-srcs/make-pr.sh @@ -6,6 +6,8 @@ co=$2 export GIT_CONFIG_GLOBAL=/dev/null export GIT_CONFIG_NOSYSTEM=1 +export GIT_AUTHOR_NAME="GrahamCOfBorg" +export GIT_AUTHOR_EMAIL="graham+cofborg@example.com" makepr() { git init --bare "$bare" @@ -13,13 +15,13 @@ makepr() { cp build/* "$co/" git -C "$co" add . - git -C "$co" commit --author "GrahamCOfBorg " -m "initial repo commit" + git -C "$co" commit -m "initial repo commit" git -C "$co" push origin master cp build-pr/* "$co/" git -C "$co" checkout -b my-cool-pr git -C "$co" add . - git -C "$co" commit --author "GrahamCOfBorg " -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 }