List local branches whose configured upstream
(branch.<name>.merge resolved against branch.<name>.remote)
matches any of the given <branch> arguments.
Each <branch> is interpreted against the local repository, not
against any specific remote:
* a literal upstream short name, e.g. "origin/main" or "master"
for a branch whose upstream is local;
* a wildmatch pattern, e.g. "origin/*";
* a bare configured-remote name, e.g. "origin", which resolves
to whatever refs/remotes/origin/HEAD points at, matching how
"git checkout -b topic origin" picks a starting point.
The literal-vs-wildcard distinction is settled at parse time so
the per-branch matching loop calls wildmatch() only for genuine
wildcards. Multiple <branch> arguments are unioned. Output is
sorted by branch name.
This is the building block for --prune-merged, which deletes the
listed branches once they have landed on their upstream.
Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>