Skip to content

Commit 2353d67

Browse files
xclaessejpakkane
authored andcommitted
wrap: Raise MesonException when git command fails
This avoid printing long backtrace by default, the user already has the output of the git command printed for debugging purpose since we don't redirect stdout/stderr.
1 parent 4b72829 commit 2353d67

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mesonbuild/wrap/wrap.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ def quiet_git(cmd: T.List[str], workingdir: str) -> T.Tuple[bool, str]:
6161
def verbose_git(cmd: T.List[str], workingdir: str, check: bool = False) -> bool:
6262
if not GIT:
6363
return False
64-
return git(cmd, workingdir, check=check).returncode == 0
64+
try:
65+
return git(cmd, workingdir, check=check).returncode == 0
66+
except subprocess.CalledProcessError:
67+
raise WrapException('Git command failed')
6568

6669
def whitelist_wrapdb(urlstr: str) -> urllib.parse.ParseResult:
6770
""" raises WrapException if not whitelisted subdomain """

0 commit comments

Comments
 (0)