Commit 4f852484 authored by Julien Muchembled's avatar Julien Muchembled

gitclone: new 'shared' option

parent af657749
Pipeline #3004 skipped
...@@ -437,14 +437,6 @@ The default git command is `git`, if for a any reason you don't ...@@ -437,14 +437,6 @@ The default git command is `git`, if for a any reason you don't
have git in your path, you can specify git binary path with `git-command` have git in your path, you can specify git binary path with `git-command`
option. option.
Sparse checkout
~~~~~~~~~~~~~~~
The value of the `sparse-checkout` option is written to the
``$GITDIR/info/sparse-checkout`` file, which is used to populate the working
directory sparsely. See the `SPARSE CHECKOUT` section of ``git-read-tree``
command. This feature is disabled if the value is empty or unset.
Ignore SSL certificate Ignore SSL certificate
~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
...@@ -461,6 +453,18 @@ boolean option:: ...@@ -461,6 +453,18 @@ boolean option::
repository = https://example.net/example.git/ repository = https://example.net/example.git/
ignore-ssl-certificate = true ignore-ssl-certificate = true
Other options
~~~~~~~~~~~~~
shared
Clone with ``--shared`` option if true. See ``git-clone`` command.
sparse-checkout
The value of the `sparse-checkout` option is written to the
``$GITDIR/info/sparse-checkout`` file, which is used to populate the working
directory sparsely. See the `SPARSE CHECKOUT` section of ``git-read-tree``
command. This feature is disabled if the value is empty or unset.
Full example Full example
~~~~~~~~~~~~ ~~~~~~~~~~~~
......
...@@ -140,8 +140,10 @@ class Recipe(object): ...@@ -140,8 +140,10 @@ class Recipe(object):
self.git_command = 'git' self.git_command = 'git'
self.sparse = options.get('sparse-checkout', '').strip() self.sparse = options.get('sparse-checkout', '').strip()
# Set boolean values # Set boolean values
for key in ('develop', 'use-cache', 'ignore-ssl-certificate'): for key in ('develop', 'shared', 'use-cache', 'ignore-ssl-certificate'):
setattr(self, key.replace('-', '_'), options.get(key, '').lower() in TRUE_VALUES) setattr(self, key.replace('-', '_'), options.get(key, '').lower() in TRUE_VALUES)
if self.shared:
self.use_cache = False
self.networkcache = buildout.get('networkcache', {}) self.networkcache = buildout.get('networkcache', {})
...@@ -194,6 +196,8 @@ class Recipe(object): ...@@ -194,6 +196,8 @@ class Recipe(object):
self.repository, self.repository,
self.location] self.location]
config = [] config = []
if self.shared:
git_clone_command.append('--shared')
if self.sparse: if self.sparse:
git_clone_command.append('--no-checkout') git_clone_command.append('--no-checkout')
config.append('core.sparseCheckout=true') config.append('core.sparseCheckout=true')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment