mirror of
https://github.com/go-gitea/gitea
synced 2024-10-31 23:34:25 +00:00
6ddd3b0b47
* Fix validate() function to handle errors in embedded anon structs * Implement webhook branch filter See #2025, #3998.
27 lines
552 B
Bash
Vendored
27 lines
552 B
Bash
Vendored
#! /bin/bash
|
|
|
|
bench() {
|
|
filename="/tmp/$1-$2.bench"
|
|
if test -e "${filename}";
|
|
then
|
|
echo "Already exists ${filename}"
|
|
else
|
|
backup=`git rev-parse --abbrev-ref HEAD`
|
|
git checkout $1
|
|
echo -n "Creating ${filename}... "
|
|
go test ./... -run=NONE -bench=$2 > "${filename}" -benchmem
|
|
echo "OK"
|
|
git checkout ${backup}
|
|
sleep 5
|
|
fi
|
|
}
|
|
|
|
|
|
to=$1
|
|
current=`git rev-parse --abbrev-ref HEAD`
|
|
|
|
bench ${to} $2
|
|
bench ${current} $2
|
|
|
|
benchcmp $3 "/tmp/${to}-$2.bench" "/tmp/${current}-$2.bench"
|