Make sure that the given ref name really exists.
(branch)
| 1165 | |
| 1166 | |
| 1167 | def branch_exists(branch): |
| 1168 | """Make sure that the given ref name really exists.""" |
| 1169 | |
| 1170 | cmd = ["git", "rev-parse", "--symbolic", "--verify", branch] |
| 1171 | p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
| 1172 | out, _ = p.communicate() |
| 1173 | out = decode_text_stream(out) |
| 1174 | if p.returncode: |
| 1175 | return False |
| 1176 | # expect exactly one line of output: the branch name |
| 1177 | return out.rstrip() == branch |
| 1178 | |
| 1179 | |
| 1180 | def findUpstreamBranchPoint(head="HEAD"): |
no test coverage detected