From c05e1396625b14e66d795408ea2ae4cd2afc3209 Mon Sep 17 00:00:00 2001 From: Ola Redell Date: Thu, 12 Jan 2017 11:33:27 +0100 Subject: gitsm.py: Add force flag to git checkout command in update_submodules When the gitsm fetcher is used with a repo that includes a .gitattributes file that makes git modify files on cloning (e.g. line break characters), the subsequent checkout performed in the update_submodules function fails. This is fixed by adding the force flag (-f) to the checkout command. Signed-off-by: Ola Redell Signed-off-by: Richard Purdie --- lib/bb/fetch2/gitsm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py index 661376204..939fb3f09 100644 --- a/lib/bb/fetch2/gitsm.py +++ b/lib/bb/fetch2/gitsm.py @@ -108,7 +108,7 @@ class GitSM(Git): os.rename(ud.clonedir, gitdir) runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*true/bare = false/'", d) runfetchcmd(ud.basecmd + " reset --hard", d, workdir=tmpclonedir) - runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=tmpclonedir) + runfetchcmd(ud.basecmd + " checkout -f " + ud.revisions[ud.names[0]], d, workdir=tmpclonedir) runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=tmpclonedir) self._set_relative_paths(tmpclonedir) runfetchcmd("sed " + gitdir + "/config -i -e 's/bare.*=.*false/bare = true/'", d, workdir=tmpclonedir) -- cgit 1.2.3-korg