diff mbox series

[2/4] recipetool: go: do not restore go.mod/sum file

Message ID 20240226144040.2007482-3-lukas.funke-oss@weidmueller.com
State New
Headers show
Series go: improve vendoring | expand

Commit Message

Lukas Funke Feb. 26, 2024, 2:40 p.m. UTC
From: Lukas Funke <lukas.funke@weidmueller.com>

Do not restore 'go.mod' and 'go.sum' file after the projects go version
is updated to >= 1.17.

When we leave the go.mod file as-is then vendor manifest is created
using the < 1.17 version. This results in an inconsistency between the
patched (newer) 'go.mod' file and the 'older' modules.txt.

Signed-off-by: Lukas Funke <lukas.funke@weidmueller.com>
---
 scripts/lib/recipetool/create_go.py | 2 --
 1 file changed, 2 deletions(-)
diff mbox series

Patch

diff --git a/scripts/lib/recipetool/create_go.py b/scripts/lib/recipetool/create_go.py
index c560831442..abe1f6e0da 100644
--- a/scripts/lib/recipetool/create_go.py
+++ b/scripts/lib/recipetool/create_go.py
@@ -598,8 +598,6 @@  class GoRecipeHandler(RecipeHandler):
 
         # Create patch in order to upgrade go version
         self.__go_run_cmd("git diff go.mod > %s" % (patchfilename), srctree, d)
-        # Restore original state
-        self.__go_run_cmd("git checkout HEAD go.mod go.sum", srctree, d)
 
         go_mod = json.loads(stdout)
         tmpfile = os.path.join(localfilesdir, patchfilename)