summaryrefslogtreecommitdiffstats
path: root/git_superproject.py
diff options
context:
space:
mode:
authorRaman Tenneti <rtenneti@google.com>2021-06-02 10:05:54 -0700
committerRaman Tenneti <rtenneti@google.com>2021-06-03 00:30:10 +0000
commite253b43e17de114f1efafa9a3e3929f23115ae99 (patch)
treeaffb78d352174bde02b71316ed922b76b98ec757 /git_superproject.py
parent5d58c18146e1cda1ab9a3593fd1324985bb5d638 (diff)
downloadgit-repo-e253b43e17de114f1efafa9a3e3929f23115ae99.tar.gz
superproject: require git version 2.28.0 or higher.v2.15.4
Tested the code with the following commands. $ repo init --use-superproject -u https://android.googlesource.com/platform/manifest + Tested for the wrong git version. $ repo_dev init --use-superproject -u https://android.googlesource.com/platform/manifest WARNING: --use-superproject is experimental and not for general use superproject requires a git version 2.28 or later error: git update of superproject failed $ ./run_tests -v Bug: https://crbug.com/gerrit/14617 Bug: [google internal] b/189846687 Change-Id: I5cd4158ea29b3b3c8c81234f4e818165de346e63 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/308442 Tested-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_superproject.py')
-rw-r--r--git_superproject.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/git_superproject.py b/git_superproject.py
index 3168d9f8..62f2d52f 100644
--- a/git_superproject.py
+++ b/git_superproject.py
@@ -26,7 +26,7 @@ import hashlib
26import os 26import os
27import sys 27import sys
28 28
29from git_command import GitCommand 29from git_command import git_require, GitCommand
30from git_refs import R_HEADS 30from git_refs import R_HEADS
31 31
32_SUPERPROJECT_GIT_NAME = 'superproject.git' 32_SUPERPROJECT_GIT_NAME = 'superproject.git'
@@ -120,6 +120,9 @@ class Superproject(object):
120 print('git fetch missing drectory: %s' % self._work_git, 120 print('git fetch missing drectory: %s' % self._work_git,
121 file=sys.stderr) 121 file=sys.stderr)
122 return False 122 return False
123 if not git_require((2, 28, 0)):
124 print('superproject requires a git version 2.28 or later', file=sys.stderr)
125 return False
123 cmd = ['fetch', url, '--depth', '1', '--force', '--no-tags', '--filter', 'blob:none'] 126 cmd = ['fetch', url, '--depth', '1', '--force', '--no-tags', '--filter', 'blob:none']
124 if self._branch: 127 if self._branch:
125 cmd += [self._branch + ':' + self._branch] 128 cmd += [self._branch + ':' + self._branch]