From 08626f9e96ee80a76076fa0d1641e9f36d94eb0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Fri, 4 Jun 2021 00:27:22 +0200 Subject: [PATCH] buildscript: fix fetch step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git pull combines two steps: fetch and merge. When checking out another revision into an existing build directory, git pull tries to merge the changes from the new revision into the current HEAD, before checking out the new revision with git checkout. Because we apply various patches to OpenWrt, the merge step almost certainly fails, so the new revision is not checked out. As the merge isn't needed anyway, use git fetch instead, which only fetches updates from the remote without actually applying them. Signed-off-by: Fabian Bläse --- buildscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildscript b/buildscript index da096193..0d89dab3 100755 --- a/buildscript +++ b/buildscript @@ -62,7 +62,7 @@ checkout_git(){ # Select desired commit and remove local changes (-f) if ! $MYGIT checkout -f "$COMMITID" ; then echo "commitid not found trying to fetch new commits" - $MYGIT pull && $MYGIT checkout "$COMMITID" + $MYGIT fetch --all && $MYGIT checkout "$COMMITID" fi else echo "wrong remote or not an git repo at all -> deleting whole directory"