The output of 'git branch' is not guaranteed to remain constant. Using the for-each-ref plumbing command should work reliably for longer.
attachment 0001-fedpkg-Use-git-plumbing-to-complete-branch-names.patch
Applied.