if [ -e "$GIT_DIR/refs/patches/$b" ]; then
# StGIT branch: show all patches
refdirs="$refdirs $GIT_DIR/refs/heads/$b $GIT_DIR/refs/patches/$b"
elif [ -e "$GIT_DIR/refs/heads/$b" ]; then
# other GIT branch
refdirs="$refdirs $GIT_DIR/refs/heads/$b"
if [ -e "$GIT_DIR/refs/patches/$b" ]; then
# StGIT branch: show all patches
refdirs="$refdirs $GIT_DIR/refs/heads/$b $GIT_DIR/refs/patches/$b"
elif [ -e "$GIT_DIR/refs/heads/$b" ]; then
# other GIT branch
refdirs="$refdirs $GIT_DIR/refs/heads/$b"