| Conditions | 3 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # Copyright 2017 Starbot Discord Project |
||
| 25 | def git_branch(): |
||
| 26 | '''Get the current git branch.''' |
||
| 27 | with open(".git/HEAD") as file: |
||
| 28 | head_string = file.read() |
||
| 29 | head_split = head_string.split(": ") |
||
| 30 | if len(head_split) == 2: |
||
| 31 | branch = head_split[1].split("/", 2)[-1] |
||
| 32 | msg = branch.strip() |
||
| 33 | else: |
||
| 34 | msg = "UNKNOWN" |
||
| 35 | return msg |
||
| 36 | |||
| 42 | return line.split("url = ")[1].strip() |