Get the symbolic name for the current git branch
()
| 41 | |
| 42 | |
| 43 | def get_git_branch(): |
| 44 | """Get the symbolic name for the current git branch""" |
| 45 | cmd = "git rev-parse --abbrev-ref HEAD".split() |
| 46 | try: |
| 47 | return subprocess.check_output(cmd, |
| 48 | stderr=subprocess.DEVNULL, |
| 49 | cwd=SRCDIR, |
| 50 | encoding='UTF-8') |
| 51 | except subprocess.CalledProcessError: |
| 52 | return None |
| 53 | |
| 54 | |
| 55 | def get_git_upstream_remote(): |
no test coverage detected
searching dependent graphs…