Skip to content

Instantly share code, notes, and snippets.

@marc-hb
Created March 16, 2021 04:24
Show Gist options
  • Save marc-hb/85d7bad9f04ededa4f46273004545819 to your computer and use it in GitHub Desktop.
Save marc-hb/85d7bad9f04ededa4f46273004545819 to your computer and use it in GitHub Desktop.
west --depth 1 hack
diff --git a/src/west/app/project.py b/src/west/app/project.py
index b7abd1105be7..7c8a7a621736 100644
--- a/src/west/app/project.py
+++ b/src/west/app/project.py
@@ -373,16 +373,16 @@ With neither, -m {MANIFEST_URL_DEFAULT} is assumed.
if maybe_sha:
# Fetch the ref-space and hope the SHA is contained in
# that ref-space
- self.check_call(('git', 'fetch', 'origin', '--tags',
- '--', 'refs/heads/*:refs/remotes/origin/*'),
+ self.check_call(('git', 'fetch', 'origin', '--depth', '1',
+ '--', 'refs/heads/master:refs/remotes/origin/master'),
cwd=dest)
else:
# Fetch the ref-space similar to git clone plus the ref
# given by user. Redundancy is ok, for example if the user
# specifies 'heads/master'. This allows users to specify:
# pull/<no>/head for pull requests
- self.check_call(('git', 'fetch', 'origin', '--tags', '--',
- rev, 'refs/heads/*:refs/remotes/origin/*'),
+ self.check_call(('git', 'fetch', 'origin', '--depth', '1', '--',
+ rev, 'refs/heads/master:refs/remotes/origin/master'),
cwd=dest)
try:
@@ -1409,7 +1409,7 @@ def _fetch(project, rev=None):
#
# --tags is required to get tags, since the remote is specified as a URL.
log.small_banner(msg)
- project.git(['fetch', '-f', '--tags'] + depth +
+ project.git(['fetch', '-f', '--depth', '1' ] +
['--', project.url, refspec])
_update_manifest_rev(project, next_manifest_rev)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment