X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=detached-head%2Ffix-detached-head;h=44b98443da82158f004c3a34239bc22b0d2b2d21;hp=bb7594176cb64642ed32c861b8a3ac94afae149d;hb=b90789d369c5500fa85a0954869626e8aa3566ce;hpb=0a8706b3269a0fbeadd07ad87bc31a73ac54c519 diff --git a/detached-head/fix-detached-head b/detached-head/fix-detached-head index bb75941..44b9844 100755 --- a/detached-head/fix-detached-head +++ b/detached-head/fix-detached-head @@ -12,7 +12,7 @@ if [ "${#branches[*]}" -eq 0 ]; then fi if [ "${#branches[*]}" -eq 0 ]; then - branches=(`git branch --points-at=HEAD -r | sed 's!^ *origin/!!'`) + branches=(`git for-each-ref --format="%(refname:lstrip=3)" --points-at=HEAD refs/remotes | sort -u`) fi if [ "${#branches[*]}" -eq 0 ]; then