1
0
Fork 0

don't fail if there is no gc_counter

This commit is contained in:
Mikhail Goncharov 2023-09-01 16:55:50 +02:00
parent e1a4fda524
commit 807132089c

View file

@ -22,7 +22,7 @@ if [ -d "$BUILDKITE_BUILD_CHECKOUT_PATH" ]; then
echo "Remote URL does not match. Deleting and recreating the directory." echo "Remote URL does not match. Deleting and recreating the directory."
cd /c/ cd /c/
rm -rf "$BUILDKITE_BUILD_CHECKOUT_PATH" rm -rf "$BUILDKITE_BUILD_CHECKOUT_PATH"
rm /c/ws/git_gc_counter rm -rf /c/ws/git_gc_counter
else else
# Run git gc from time to time to prevent repo from growing. # Run git gc from time to time to prevent repo from growing.
echo -n "x" >> /c/ws/git_gc_counter echo -n "x" >> /c/ws/git_gc_counter
@ -30,7 +30,7 @@ if [ -d "$BUILDKITE_BUILD_CHECKOUT_PATH" ]; then
if [ "$(wc -c < /c/ws/git_gc_counter)" -gt 10 ]; then if [ "$(wc -c < /c/ws/git_gc_counter)" -gt 10 ]; then
echo "Running 'git gc'..." echo "Running 'git gc'..."
git gc git gc
rm /c/ws/git_gc_counter rm -rf /c/ws/git_gc_counter
fi fi
fi fi
fi fi