diff options
author | Raman Tenneti <rtenneti@google.com> | 2021-06-02 10:05:54 -0700 |
---|---|---|
committer | Raman Tenneti <rtenneti@google.com> | 2021-06-03 00:30:10 +0000 |
commit | e253b43e17de114f1efafa9a3e3929f23115ae99 (patch) | |
tree | affb78d352174bde02b71316ed922b76b98ec757 /git_superproject.py | |
parent | 5d58c18146e1cda1ab9a3593fd1324985bb5d638 (diff) | |
download | git-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.py | 5 |
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 | |||
26 | import os | 26 | import os |
27 | import sys | 27 | import sys |
28 | 28 | ||
29 | from git_command import GitCommand | 29 | from git_command import git_require, GitCommand |
30 | from git_refs import R_HEADS | 30 | from 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] |