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,
))
# 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",