From 8e185e437d962537f24f9f43655650954f0c7491 Mon Sep 17 00:00:00 2001 From: nrovinskiy Date: Sun, 15 Oct 2023 21:35:39 -0700 Subject: [PATCH] Fix --- thirdparty_build.gradle | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/thirdparty_build.gradle b/thirdparty_build.gradle index 45ecac502..69436f291 100644 --- a/thirdparty_build.gradle +++ b/thirdparty_build.gradle @@ -11,17 +11,14 @@ task downloadDjvu { doLast { def djvuFolder = new File(djvu) if (djvuFolder.exists()) { - // Clean previous checkout + // Switch to master so we can properly pull if it was + // detached. exec { - commandLine = ['git', '-C', djvu, 'checkout', '.'] - } - // Switch to master - exec { - commandLine = ['git', '-C', djvu, 'checkout', 'master'] + commandLine = ['git', '-C', djvu, 'checkout', '-f', 'master'] } // Pull exec { - commandLine = ['git', '-C', djvu, 'pull'] + commandLine = ['git', '-C', djvu, 'fetch', 'origin'] } } else { @@ -71,17 +68,14 @@ task downloadMupdf { doLast { def mupdfFolder = new File(mupdf) if (mupdfFolder.exists()) { - // Clean previous checkout - exec { - commandLine = ['git', '-C', mupdf, 'checkout', '.'] - } - // Switch to master + // Switch to master so we can properly pull if it was + // detached. exec { - commandLine = ['git', '-C', mupdf, 'checkout', 'master'] + commandLine = ['git', '-C', mupdf, 'checkout', '-f', 'master'] } // Pull exec { - commandLine = ['git', '-C', mupdf, 'pull'] + commandLine = ['git', '-C', mupdf, 'fetch', 'origin'] } } else {