Add depth option to git shallow-clone
- Use convert xml for shallow-clone and depth Change-Id: I92d4bd2ded6db66bb608aed480e873e29e7b9474
This commit is contained in:
parent
52d2db4984
commit
4167cc5dbd
@ -169,6 +169,7 @@ def git(registry, xml_parent, data):
|
||||
* **scm-name** (`string`) - The unique scm name for this Git SCM
|
||||
(optional)
|
||||
* **shallow-clone** (`bool`) - Perform shallow clone (default false)
|
||||
* **depth** (`int`) - Set shallow clone depth (default 1)
|
||||
* **do-not-fetch-tags** (`bool`) - Perform a clone without tags
|
||||
(default false)
|
||||
* **sparse-checkout** (`dict`)
|
||||
@ -381,8 +382,10 @@ def git(registry, xml_parent, data):
|
||||
)
|
||||
if any(key in data for key in clone_options):
|
||||
clo = XML.SubElement(exts_node, impl_prefix + 'CloneOption')
|
||||
XML.SubElement(clo, 'shallow').text = str(
|
||||
data.get('shallow-clone', False)).lower()
|
||||
clone_mapping = [
|
||||
('shallow-clone', 'shallow', False),
|
||||
('depth', 'depth', 1)]
|
||||
convert_mapping_to_xml(clo, data, clone_mapping, fail_required=True)
|
||||
if 'do-not-fetch-tags' in data:
|
||||
XML.SubElement(clo, 'noTags').text = str(
|
||||
data.get('do-not-fetch-tags', False)).lower()
|
||||
|
@ -37,6 +37,7 @@
|
||||
<hudson.plugins.git.extensions.impl.CleanBeforeCheckout/>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>true</shallow>
|
||||
<depth>1</depth>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<hudson.plugins.git.extensions.impl.SubmoduleOption>
|
||||
<disableSubmodules>false</disableSubmodules>
|
||||
|
@ -26,6 +26,7 @@
|
||||
<extensions>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>false</shallow>
|
||||
<depth>1</depth>
|
||||
<noTags>true</noTags>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
||||
|
@ -28,6 +28,7 @@
|
||||
<hudson.plugins.git.extensions.impl.CleanCheckout/>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>true</shallow>
|
||||
<depth>1</depth>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
||||
</extensions>
|
||||
|
@ -27,6 +27,7 @@
|
||||
<hudson.plugins.git.extensions.impl.CleanCheckout/>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>false</shallow>
|
||||
<depth>1</depth>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<hudson.plugins.git.extensions.impl.WipeWorkspace/>
|
||||
</extensions>
|
||||
|
@ -29,6 +29,7 @@
|
||||
<extensions>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>false</shallow>
|
||||
<depth>1</depth>
|
||||
<timeout>20</timeout>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<hudson.plugins.git.extensions.impl.CheckoutOption>
|
||||
|
@ -34,7 +34,8 @@
|
||||
</options>
|
||||
</hudson.plugins.git.extensions.impl.ChangelogToBranch>
|
||||
<hudson.plugins.git.extensions.impl.CloneOption>
|
||||
<shallow>false</shallow>
|
||||
<shallow>true</shallow>
|
||||
<depth>3</depth>
|
||||
<noTags>false</noTags>
|
||||
<timeout>20</timeout>
|
||||
</hudson.plugins.git.extensions.impl.CloneOption>
|
||||
|
@ -6,6 +6,8 @@ scm:
|
||||
- stable
|
||||
browser: githubweb
|
||||
browser-url: http://github.com/foo/example.git
|
||||
shallow-clone: true
|
||||
depth: 3
|
||||
timeout: 20
|
||||
do-not-fetch-tags: false
|
||||
changelog-against:
|
||||
|
Loading…
x
Reference in New Issue
Block a user