There is a better way to do this:
`branch = '%c %s' % (u'\u2693', detached_ref)`
It's easier to read and it prevents to have a unicode character in the code (also I guess it's a little bit faster since it doesn't call any functions).