fboender / multi-git-status

Show uncommitted, untracked and unpushed changes for multiple Git repos
MIT License
470 stars 73 forks source link

branches in .git/logs/refs/heads are not checked, but do show up as branches in git-branch #30

Open jauco opened 4 years ago

jauco commented 4 years ago

I have an (old) git repo that has a branch that is not in .git/refs/heads but in .git/logs/refs/heads. It shows up as a normal branch in git branch and also when doing git for-each-ref --format '%(refname:short)' refs/heads/. Maybe we should replace the for REF_HEAD in $(cd $GIT_DIR/refs/heads with the git for-each-ref command? (I'd be happy to provide a PR)

jauco commented 4 years ago

Just checked with another repo that I've had on my laptop for a few years now. It contains files in logs/refs/heads that are not in refs/heads and do show up in git branch. Files that appear in both directories and also files that appear in logs/refs/heads that are in refs/heads and that do not show up in git branch. Apperently the logic is not trivial.