mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-05 13:14:46 +02:00
tools/github-fetch: handle non-fast-forward merges
We don't particularly care if someone force-pushed master, just fetch the latest repo. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
f2daec4318
commit
17ced0ee38
|
@ -60,7 +60,9 @@ def fetchall(args):
|
||||||
outpath = os.path.join(args.outdir, name)
|
outpath = os.path.join(args.outdir, name)
|
||||||
if os.path.exists(outpath):
|
if os.path.exists(outpath):
|
||||||
print('Update %s' % outpath)
|
print('Update %s' % outpath)
|
||||||
ret = subprocess.call(['git', 'pull'], cwd=outpath)
|
ret = subprocess.call(['git', 'fetch'], cwd=outpath)
|
||||||
|
if ret == 0:
|
||||||
|
ret = subprocess.call(['git', 'reset', '--hard', 'FETCH_HEAD'], cwd=outpath)
|
||||||
else:
|
else:
|
||||||
print('Fetch %s' % clone_url)
|
print('Fetch %s' % clone_url)
|
||||||
ret = subprocess.call(['git', 'clone', clone_url, name], cwd=args.outdir)
|
ret = subprocess.call(['git', 'clone', clone_url, name], cwd=args.outdir)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user