summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/devtool/standard.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 6674e67267..d0d8cb85a2 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -661,7 +661,18 @@ def _extract_source(srctree, keep_temp, devbranch, sync, config, basepath, works
661 srctree_localdir = os.path.join(srctree, 'oe-local-files') 661 srctree_localdir = os.path.join(srctree, 'oe-local-files')
662 662
663 if sync: 663 if sync:
664 bb.process.run('git fetch file://' + srcsubdir + ' ' + devbranch + ':' + devbranch, cwd=srctree) 664 try:
665 logger.info('Backing up current %s branch as branch: %s.bak' % (devbranch, devbranch))
666 bb.process.run('git branch -f ' + devbranch + '.bak', cwd=srctree)
667
668 # Use git fetch to update the source with the current recipe
669 # To be able to update the currently checked out branch with
670 # possibly new history (no fast-forward) git needs to be told
671 # that's ok
672 logger.info('Syncing source files including patches to git branch: %s' % devbranch)
673 bb.process.run('git fetch --update-head-ok --force file://' + srcsubdir + ' ' + devbranch + ':' + devbranch, cwd=srctree)
674 except bb.process.ExecutionError as e:
675 raise DevtoolError("Error when syncing source files to local checkout: %s" % str(e))
665 676
666 # Move the oe-local-files directory to srctree. 677 # Move the oe-local-files directory to srctree.
667 # As oe-local-files is not part of the constructed git tree, 678 # As oe-local-files is not part of the constructed git tree,