This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Adds reference to GitHub issue if available in branch name. | |
| # The issue number should be at the end of the branch name, following | |
| # a hyphen. | |
| # Only proceed if no second parameter is given to the script. | |
| if [ x = x${2} ]; then | |
| branch=$(git symbolic-ref --short HEAD) | |
| if [[ $branch =~ ^([^/]+)(/([A-Z]+\-[0-9]+))? ]]; then |