#!/usr/bin/env bash
if [ -f gitnu ]; then
cargo build --release
GITNU=$PWD/target/release/gitnu
else
GITNU=$PWD/gitnu
fi
echo "$GITNU"
pushd >/dev/null /tmp
echo "$GITNU"
c() {
cd /tmp
rm -rf gitnu_bench
}
trap c EXIT
mkdir -p gitnu_bench && cd gitnu_bench
git init
let i=0
let lim=200
bench() {
while [ $i -lt $lim ]; do
touch $i
$GITNU status >/dev/null
$GITNU add $i >/dev/null
echo "done #$i"
let i++
done
}
time bench