"""
import argparse
+import os
+from pathlib import Path
import subprocess
import sys
from typing import List, Tuple, Union
parser = get_parser()
opts = parser.parse_args(argv)
- lbranch = get_local_branch()
+ try:
+ lbranch = get_local_branch()
+ except subprocess.CalledProcessError as e:
+ sys.exit(f'{os.path.basename(sys.argv[0])}: {Path.cwd()}:\n{e}\n{e.stderr.strip()}')
print(f'Local branch resolved to "{lbranch}".')
if not lbranch:
print('Unable to resolve local branch', file=sys.stderr)