]> code.ossystems Code Review - openembedded-core.git/commitdiff
devtool: sdk-update: fix pulling updates from git
authorAndrea Galbusera <gizero@gmail.com>
Mon, 31 Jul 2017 09:19:17 +0000 (11:19 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 9 Aug 2017 08:24:03 +0000 (09:24 +0100)
Commit 4657bc9d165e51981e034e73e7b92552e873eef7 replaced the git pull logic with
the git fetch + git reset --hard combo, but resetting to HEAD does not really
pull in new commits from remote... Replace with resetting to the upstream branch
instead.

Signed-off-by: Andrea Galbusera <gizero@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/lib/devtool/sdk.py

index e8bf0ad98c23132f7993018b5f1451cbece6a6fc..f46577c2abaea710b7f940e93c904047a09d2ca8 100644 (file)
@@ -155,7 +155,7 @@ def sdk_update(args, config, basepath, workspace):
         if os.path.exists(os.path.join(basepath, 'layers/.git')):
             out = subprocess.check_output("git status --porcelain", shell=True, cwd=layers_dir)
             if not out:
-                ret = subprocess.call("git fetch --all; git reset --hard", shell=True, cwd=layers_dir)
+                ret = subprocess.call("git fetch --all; git reset --hard @{u}", shell=True, cwd=layers_dir)
             else:
                 logger.error("Failed to update metadata as there have been changes made to it. Aborting.");
                 logger.error("Changed files:\n%s" % out);