You can ask git branch directly which branches contain the commit in question:
% git branch -a --contains 4f08c85ad
* master
remotes/origin/bug_872
remotes/origin/bug_898
remotes/origin/master
You can ask git branch directly which branches contain the commit in question:
% git branch -a --contains 4f08c85ad
* master
remotes/origin/bug_872
remotes/origin/bug_898
remotes/origin/master