Also abort if 'git status' fails
This commit is contained in:
parent
82d6760c5a
commit
d62b9db896
@ -7241,11 +7241,12 @@ def fpull(cli, nick, chan, rest):
|
|||||||
"""Pulls from the repository to update the bot."""
|
"""Pulls from the repository to update the bot."""
|
||||||
|
|
||||||
(ret, _) = _call_command(cli, nick, chan, "git fetch")
|
(ret, _) = _call_command(cli, nick, chan, "git fetch")
|
||||||
|
|
||||||
if ret != 0:
|
if ret != 0:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
(_, out) = _call_command(cli, nick, chan, "git status -b --porcelain", no_out=True)
|
(ret, out) = _call_command(cli, nick, chan, "git status -b --porcelain", no_out=True)
|
||||||
|
if ret != 0:
|
||||||
|
return False
|
||||||
|
|
||||||
if not re.search(rb"behind \d+", out.splitlines()[0]):
|
if not re.search(rb"behind \d+", out.splitlines()[0]):
|
||||||
# Already up-to-date
|
# Already up-to-date
|
||||||
@ -7253,7 +7254,6 @@ def fpull(cli, nick, chan, rest):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
(ret, _) = _call_command(cli, nick, chan, "git rebase --stat --preserve-merges")
|
(ret, _) = _call_command(cli, nick, chan, "git rebase --stat --preserve-merges")
|
||||||
|
|
||||||
return (ret == 0)
|
return (ret == 0)
|
||||||
|
|
||||||
@cmd("update", flag="D", pm=True)
|
@cmd("update", flag="D", pm=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user