trap 'rm -Rf -- "$tempdir"' EXIT
# Ensure git-remote-gcrypt is in PATH
-repo_root=$(git rev-parse --show-toplevel)
+repo_root="${PWD}"
test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test")
cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt"
sed "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt" >"$tempdir/git-remote-gcrypt.tmp"
trap "rm -Rf -- '${tempdir}'" EXIT
# Set up the PATH
-repo_root=$(git rev-parse --show-toplevel)
+repo_root="${PWD}"
test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test")
cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt"
sed -i "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt"
{
git init -- "${tempdir}/first"
cd "${tempdir}/first"
+ git checkout -b "${default_branch}"
for ((i = 0; i < num_commits; ++i)); do
for ((j = 0; j < files_per_commit; ++j)); do
file_index=$((i * files_per_commit + j))
# Set up the PATH to favor the version of git-remote-gcrypt from the repository
# rather than a version that might already be installed on the user's system.
# We also copy it to tempdir to inject a version number for testing.
-repo_root=$(git rev-parse --show-toplevel)
+repo_root="${PWD}"
test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test")
cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt"
sed "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt" > "$tempdir/git-remote-gcrypt.tmp"