I think this will produce invalid branch names.  We probably need to run the same replacement algorithm we do for creating S3-safe emails (basically, replace anything not a character or digit with a dash).