def branches_containing_commit(commit_ref)
      `git branch --column=dense --contains #{commit_ref}`.
        sub(/\((HEAD )?detached (from|at) .*?\)/, ''). # ignore detached HEAD
        split(/\s+/).
        reject { |s| s.empty? || s == '*' }
    end
def branches_containing_commit(commit_ref)
      `git branch --column=dense --contains #{commit_ref}`.
        sub(/\((HEAD )?detached (from|at) .*?\)/, ''). # ignore detached HEAD
        split(/\s+/).
        reject { |s| s.empty? || s == '*' }
    end
Returns the names of all branches containing the given commit.

 @param commit_ref [String] git tree ref that resolves to a commit
 @return [Array<String>] list of branches containing the given commit