diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-30 12:15:07 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-03-30 12:15:07 -0400 |
commit | df1776a39a8df7e140ae3e62efe4c82895a1e91c (patch) | |
tree | 93f6e546f80f1e54227d28d2f1c178d2591d3cb4 /b4/pr.py | |
parent | e110a35e7ea0a1c2bb3c350487a9fe34984592bf (diff) | |
download | b4-df1776a39a8df7e140ae3e62efe4c82895a1e91c.tar.gz |
PR: fix when gitdir is specified via -g
Fix some leftover bugs from prototyping stage when we were always
assuming to run from a checkout.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Diffstat (limited to 'b4/pr.py')
-rw-r--r-- | b4/pr.py | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -133,7 +133,7 @@ def fetch_remote(gitdir, lmsg, branch=None): # Fetch it now logger.info(' Fetching %s %s', lmsg.pr_repo, lmsg.pr_ref) gitargs = ['fetch', lmsg.pr_repo, lmsg.pr_ref] - ecode, out = b4.git_run_command(None, gitargs, logstderr=True) + ecode, out = b4.git_run_command(gitdir, gitargs, logstderr=True) if ecode > 0: logger.critical('ERROR: Could not fetch remote:') logger.critical(out) @@ -143,7 +143,7 @@ def fetch_remote(gitdir, lmsg, branch=None): if branch: gitargs = ['checkout', '-b', branch, 'FETCH_HEAD'] logger.info('Fetched into branch %s', branch) - ecode, out = b4.git_run_command(None, gitargs) + ecode, out = b4.git_run_command(gitdir, gitargs) if ecode > 0: logger.critical('ERROR: Failed to create branch') logger.critical(out) @@ -156,7 +156,9 @@ def fetch_remote(gitdir, lmsg, branch=None): def explode(gitdir, lmsg, savefile): # We always fetch into FETCH_HEAD when exploding - fetch_remote(gitdir, lmsg) + ecode = fetch_remote(gitdir, lmsg) + if ecode > 0: + sys.exit(ecode) logger.info('Generating patches starting from the base-commit') reroll = None if lmsg.revision > 1: |