mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-02 11:28:20 +00:00
Handle fast forward in update-coverity-branch.py
This commit is contained in:
parent
49382a0aa7
commit
3814a07c44
@ -5,20 +5,23 @@
|
|||||||
|
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
import shutil, tempfile
|
import shutil, tempfile
|
||||||
from subprocess import check_call
|
from subprocess import check_output, STDOUT
|
||||||
|
|
||||||
class Git:
|
class Git:
|
||||||
def __init__(self, dir):
|
def __init__(self, dir):
|
||||||
self.dir = dir
|
self.dir = dir
|
||||||
|
|
||||||
def __call__(self, *args):
|
def __call__(self, *args):
|
||||||
check_call(['git'] + list(args), cwd=self.dir)
|
output = check_output(['git'] + list(args), cwd=self.dir, stderr=STDOUT)
|
||||||
|
print(output)
|
||||||
|
return output
|
||||||
|
|
||||||
dir = tempfile.mkdtemp()
|
dir = tempfile.mkdtemp()
|
||||||
try:
|
try:
|
||||||
git = Git(dir)
|
git = Git(dir)
|
||||||
git('clone', '-b', 'coverity', 'git@github.com:cppformat/cppformat.git', dir)
|
git('clone', '-b', 'coverity', 'git@github.com:cppformat/cppformat.git', dir)
|
||||||
git('merge', '-X', 'theirs', '--no-commit', 'origin/master')
|
output = git('merge', '-X', 'theirs', '--no-commit', 'origin/master')
|
||||||
|
if 'Fast-forward' not in output:
|
||||||
git('reset', 'HEAD', '.travis.yml')
|
git('reset', 'HEAD', '.travis.yml')
|
||||||
git('checkout', '--', '.travis.yml')
|
git('checkout', '--', '.travis.yml')
|
||||||
git('commit', '-m', 'Update coverity branch')
|
git('commit', '-m', 'Update coverity branch')
|
||||||
|
Loading…
Reference in New Issue
Block a user