| 1 | module git |
| 2 | |
| 3 | fn test_get_branch_name_from_reference() { |
| 4 | assert get_branch_name_from_reference('refs/heads/master') == 'master' |
| 5 | assert get_branch_name_from_reference('refs/heads/main') == 'main' |
| 6 | assert get_branch_name_from_reference('refs/heads/fix-110') == 'fix-110' |
| 7 | } |
| 8 | |
| 9 | fn test_split_command_keeps_quoted_arguments() { |
| 10 | assert split_command('--no-pager log main --pretty="%h %s"') == ['--no-pager', 'log', 'main', |
| 11 | '--pretty=%h %s'] |
| 12 | assert split_command('archive v1.0 --format=zip --output="/tmp/release archive.zip"') == [ |
| 13 | 'archive', |
| 14 | 'v1.0', |
| 15 | '--format=zip', |
| 16 | '--output=/tmp/release archive.zip', |
| 17 | ] |
| 18 | } |
| 19 | |