diff options
author | Jason Chang <jasonnc@google.com> | 2023-05-23 13:06:55 -0700 |
---|---|---|
committer | Jason Chang <jasonnc@google.com> | 2023-05-25 22:37:04 +0000 |
commit | 17833322d9e0c650310e55f806d5e3545c265c2a (patch) | |
tree | 67cd339bede0227bd43bd1e6fb9cc66fcb83d6b4 /manifest_xml.py | |
parent | 04cba4add52b11a27d09d73c2cbfebcd67a1f2cc (diff) | |
download | git-repo-17833322d9e0c650310e55f806d5e3545c265c2a.tar.gz |
Add envar to replace shallow clones with partial
An investigation go/git-repo-shallow shows a number of problems
when doing a shallow git fetch/clone. This change introduces an
environment variable REPO_ALLOW_SHALLOW. When this environment variable
is set to 1 during a repo init or repo sync all shallow git fetch
commands are replaced with partial fetch commands. Any shallow
repository needing update is unshallowed. This behavior continues until
a subsequent repo sync command is run with REPO_ALLOW_SHALLOW set to 1.
Bug: b/274340522
Change-Id: I1c3188270629359e52449788897d9d4988ebf280
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/374754
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Tested-by: Jason Chang <jasonnc@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r-- | manifest_xml.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 14b03a30..555bf736 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
@@ -982,6 +982,12 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
982 | return None | 982 | return None |
983 | 983 | ||
984 | @property | 984 | @property |
985 | def CloneFilterForDepth(self): | ||
986 | if self.manifestProject.clone_filter_for_depth: | ||
987 | return self.manifestProject.clone_filter_for_depth | ||
988 | return None | ||
989 | |||
990 | @property | ||
985 | def PartialCloneExclude(self): | 991 | def PartialCloneExclude(self): |
986 | exclude = self.manifest.manifestProject.partial_clone_exclude or "" | 992 | exclude = self.manifest.manifestProject.partial_clone_exclude or "" |
987 | return set(x.strip() for x in exclude.split(",")) | 993 | return set(x.strip() for x in exclude.split(",")) |