~ruther/emacs.d

e8303d595fc3e01157ea3c0c8b57f802af5061b5 — Rutherther 3 months ago 484708a
fix: handle more cases in android repair
1 files changed, 14 insertions(+), 2 deletions(-)

M scripts/android-repair-git
M scripts/android-repair-git => scripts/android-repair-git +14 -2
@@ 8,13 8,25 @@

checkout()
{
  # The lock is left there even when nothing uses it...
  # Of course in general this is dangerous, nothing else
  # should be accessing the repo.
  rm -rf .git/index.lock

  if [[ ! -f $repo/.git/HEAD ]]; then
    cd -
    rm -rf $repo
  fi

  if git show-ref --verify --quiet refs/remotes/origin/main; then
    git checkout -b main origin/main
    git checkout main
  elif git show-ref --verify --quiet refs/remotes/origin/master; then
    git checkout -b master origin/master
    git checkout master
  else
    echo "ERROR: No main or master branch found in $repo" >&2
  fi

  git reset --hard HEAD
}

for repo in ~/.emacs.d/stateful/elpaca/repos/*; do