diff options
-rw-r--r-- | jenkins_jobs/modules/scm.py | 2 | ||||
-rw-r--r-- | tests/scm/fixtures/git-extensions03.xml | 45 | ||||
-rw-r--r-- | tests/scm/fixtures/git-extensions03.yaml | 16 |
3 files changed, 62 insertions, 1 deletions
diff --git a/jenkins_jobs/modules/scm.py b/jenkins_jobs/modules/scm.py index 54b597c6..c82d106e 100644 --- a/jenkins_jobs/modules/scm.py +++ b/jenkins_jobs/modules/scm.py @@ -432,7 +432,7 @@ def git(registry, xml_parent, data): # The default value of per-build-tag is False if skip-tag is not set, # so we set the default value of skip-tag to True. per_build_tag_default = False - if str(data.get('skip-tag', True)).lower == 'false': + if str(data.get('skip-tag', True)).lower() == 'false': per_build_tag_default = True if str(data.get('per-build-tag', per_build_tag_default)).lower() == 'true': diff --git a/tests/scm/fixtures/git-extensions03.xml b/tests/scm/fixtures/git-extensions03.xml new file mode 100644 index 00000000..8f9fd2b9 --- /dev/null +++ b/tests/scm/fixtures/git-extensions03.xml @@ -0,0 +1,45 @@ +<?xml version="1.0" encoding="utf-8"?> +<project> + <scm class="hudson.plugins.git.GitSCM"> + <configVersion>2</configVersion> + <userRemoteConfigs> + <hudson.plugins.git.UserRemoteConfig> + <name>origin</name> + <refspec>+refs/heads/*:refs/remotes/origin/*</refspec> + <url>https://example.com/project.git</url> + </hudson.plugins.git.UserRemoteConfig> + </userRemoteConfigs> + <branches> + <hudson.plugins.git.BranchSpec> + <name>master</name> + </hudson.plugins.git.BranchSpec> + </branches> + <disableSubmodules>false</disableSubmodules> + <recursiveSubmodules>false</recursiveSubmodules> + <doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations> + <remotePoll>false</remotePoll> + <gitTool>Default</gitTool> + <submoduleCfg class="list"/> + <reference/> + <gitConfigName/> + <gitConfigEmail/> + <extensions> + <hudson.plugins.git.extensions.impl.RelativeTargetDirectory> + <relativeTargetDir>go/src/github.com/foo/example</relativeTargetDir> + </hudson.plugins.git.extensions.impl.RelativeTargetDirectory> + <hudson.plugins.git.extensions.impl.UserExclusion> + <excludedUsers>alice@example.com +bob@example.com</excludedUsers> + </hudson.plugins.git.extensions.impl.UserExclusion> + <hudson.plugins.git.extensions.impl.ScmName> + <name>something_special</name> + </hudson.plugins.git.extensions.impl.ScmName> + <hudson.plugins.git.extensions.impl.PerBuildTag/> + <hudson.plugins.git.extensions.impl.PruneStaleBranch/> + <hudson.plugins.git.extensions.impl.AuthorInChangelog/> + </extensions> + <browser class="hudson.plugins.git.browser.GithubWeb"> + <url>http://github.com/foo/example.git</url> + </browser> + </scm> +</project> diff --git a/tests/scm/fixtures/git-extensions03.yaml b/tests/scm/fixtures/git-extensions03.yaml new file mode 100644 index 00000000..98eec9c9 --- /dev/null +++ b/tests/scm/fixtures/git-extensions03.yaml @@ -0,0 +1,16 @@ +scm: + - git: + url: https://example.com/project.git + branches: + - master + browser: githubweb + browser-url: http://github.com/foo/example.git + basedir: 'go/src/github.com/foo/example' + excluded-users: + - alice@example.com + - bob@example.com + skip-tag: false + prune: true + scm-name: something_special + use-author: true + wipe-workspace: false |