[packages/rpm-build-tools] builder: skip checkout if already on the target branch
glen
glen at pld-linux.org
Mon Nov 9 14:21:24 CET 2020
commit 7a83f50c06c2a3ae1f39a80c2ddc82298b067563
Author: Elan Ruusamäe <glen at pld-linux.org>
Date: Sun Oct 25 13:16:50 2020 +0200
builder: skip checkout if already on the target branch
this avoids poisoning git reflog with entries
builder.sh | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/builder.sh b/builder.sh
index e903fc6..7d11e10 100755
--- a/builder.sh
+++ b/builder.sh
@@ -1050,7 +1050,10 @@ get_spec() {
if [ -n "$CVSTAG" ]; then
if git rev-parse --verify -q "$CVSTAG" >/dev/null; then
- git checkout "$CVSTAG" --
+ # checkout only if differs, so this will not trash git reflog
+ if [ $(git rev-parse "$CVSTAG") != $(git rev-parse HEAD) ]; then
+ git checkout "$CVSTAG" --
+ fi
elif git rev-parse --verify -q "refs/remotes/${REMOTE_PLD}/$CVSTAG"; then
git checkout -t "refs/remotes/${REMOTE_PLD}/$CVSTAG" > /dev/null
fi
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-tools.git/commitdiff/7a83f50c06c2a3ae1f39a80c2ddc82298b067563
More information about the pld-cvs-commit
mailing list