phase1: gitcheckout workaround is no longer needed
authorThibaut VARÈNE <hacks@slashdirt.org>
Tue, 25 Oct 2022 19:58:53 +0000 (21:58 +0200)
committerPetr Štetiar <ynezz@true.cz>
Mon, 15 May 2023 15:36:01 +0000 (17:36 +0200)
And it has adverse effects (slows/breaks Git step).

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
phase1/master.cfg

index 86d858deb28c25f26e4ba1cfcf4b77b9a030557f..61de307210931a251c89e29a0a313fa07bda7221 100644 (file)
@@ -605,19 +605,14 @@ for target in targets:
                hideStepIf = lambda r, s: r==results.FAILURE,
        ))
 
-       # Workaround bug when switching from a checked out tag back to a branch
-       # Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017809.html
-       factory.addStep(ShellCommand(
-               name = "gitcheckout",
-               description = "Ensure that Git HEAD is sane",
-               command = Interpolate("if [ -d .git ]; then git checkout -f %(prop:branch)s && git branch --set-upstream-to origin/%(prop:branch)s || rm -fr .git; else exit 0; fi"),
-               haltOnFailure = True))
-
        # check out the source
        # Git() runs:
          # if repo doesn't exist: 'git clone repourl'
-         # method 'clean' runs 'git clean -d -f', method fresh runs 'git clean -d -f x'. Only works with mode='full'
-         # 'git fetch -t repourl branch; git reset --hard revision'
+         # method 'clean' runs 'git clean -d -f', method fresh runs 'git clean -f -f -d -x'. Only works with mode='full'
+         # git cat-file -e <commit>
+         # git checkout -f <commit>
+         # git checkout -B <branch>
+         # git rev-parse HEAD
        factory.addStep(Git(
                name = "git",
                repourl = repo_url,
@@ -645,7 +640,7 @@ for target in targets:
        ))
 
        # Verify that Git HEAD points to a tag or branch
-       # Ref: http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017809.html
+       # Ref: https://web.archive.org/web/20190729224316/http://lists.infradead.org/pipermail/openwrt-devel/2019-June/017809.html
        factory.addStep(ShellCommand(
                name = "gitverify",
                description = "Ensure that Git HEAD is pointing to a branch or tag",