summaryrefslogtreecommitdiffstats
path: root/.local/bin/gitrect-fix
diff options
context:
space:
mode:
authorTyler Davis <tyler@gluecode.net>2023-10-31 19:30:47 -0700
committerTyler Davis <tyler@gluecode.net>2023-10-31 19:30:47 -0700
commitf37dee15783c1d30ab5f430eb7dc8e0be7cda37c (patch)
tree2096597427e6c8a134be35d4f09143d7d86ef84a /.local/bin/gitrect-fix
parentf3e786544d7a535f354b2349c3a3722f28ce6c29 (diff)
downloaddotfiles-f37dee15783c1d30ab5f430eb7dc8e0be7cda37c.tar.gz
dotfiles-f37dee15783c1d30ab5f430eb7dc8e0be7cda37c.zip
bin: trim the remote list to one head
Diffstat (limited to '.local/bin/gitrect-fix')
-rwxr-xr-x.local/bin/gitrect-fix8
1 files changed, 7 insertions, 1 deletions
diff --git a/.local/bin/gitrect-fix b/.local/bin/gitrect-fix
index 9a90647..e19a0fc 100755
--- a/.local/bin/gitrect-fix
+++ b/.local/bin/gitrect-fix
@@ -133,7 +133,13 @@ while read -r line; do
if [ $clone -gt 0 ]; then
git fetch --all
rev=$(git ls-remote origin | grep HEAD | cut -f 1)
- br=$(git ls-remote origin | grep "${rev}" | grep -v HEAD | cut -f 2 | cut -d / -f 3)
+ if [ $verbose -gt 0 ]; then
+ echo "Rev: ${rev}"
+ fi
+ br=$(git ls-remote origin | grep "${rev}" | grep -v HEAD | cut -f 2 | cut -d / -f 3|head -n 1)
+ if [ $verbose -gt 0 ]; then
+ echo "Branch: ${br}"
+ fi
git switch $br
fi
done <$DEFAULT_STATE