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

gitclone: new 'shared' option

parent af657749
......@@ -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`
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
~~~~~~~~~~~~~~~~~~~~~~
......@@ -461,6 +453,18 @@ boolean option::
repository = https://example.net/example.git/
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
~~~~~~~~~~~~
......
......@@ -140,8 +140,10 @@ class Recipe(object):
self.git_command = 'git'
self.sparse = options.get('sparse-checkout', '').strip()
# 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)
if self.shared:
self.use_cache = False
self.networkcache = buildout.get('networkcache', {})
......@@ -194,6 +196,8 @@ class Recipe(object):
self.repository,
self.location]
config = []
if self.shared:
git_clone_command.append('--shared')
if self.sparse:
git_clone_command.append('--no-checkout')
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