diff options
| -rw-r--r-- | project.py | 10 |
1 files changed, 6 insertions, 4 deletions
| @@ -1285,7 +1285,7 @@ class Project(object): | |||
| 1285 | 1285 | ||
| 1286 | need_to_fetch = not (optimized_fetch and | 1286 | need_to_fetch = not (optimized_fetch and |
| 1287 | (ID_RE.match(self.revisionExpr) and | 1287 | (ID_RE.match(self.revisionExpr) and |
| 1288 | self._CheckForSha1())) | 1288 | self._CheckForImmutableRevision())) |
| 1289 | if (need_to_fetch and | 1289 | if (need_to_fetch and |
| 1290 | not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir, | 1290 | not self._RemoteFetch(initial=is_new, quiet=quiet, alt_dir=alt_dir, |
| 1291 | current_branch_only=current_branch_only, | 1291 | current_branch_only=current_branch_only, |
| @@ -1895,7 +1895,7 @@ class Project(object): | |||
| 1895 | 1895 | ||
| 1896 | 1896 | ||
| 1897 | # Direct Git Commands ## | 1897 | # Direct Git Commands ## |
| 1898 | def _CheckForSha1(self): | 1898 | def _CheckForImmutableRevision(self): |
| 1899 | try: | 1899 | try: |
| 1900 | # if revision (sha or tag) is not present then following function | 1900 | # if revision (sha or tag) is not present then following function |
| 1901 | # throws an error. | 1901 | # throws an error. |
| @@ -1949,7 +1949,9 @@ class Project(object): | |||
| 1949 | tag_name = self.revisionExpr[len(R_TAGS):] | 1949 | tag_name = self.revisionExpr[len(R_TAGS):] |
| 1950 | 1950 | ||
| 1951 | if is_sha1 or tag_name is not None: | 1951 | if is_sha1 or tag_name is not None: |
| 1952 | if self._CheckForSha1(): | 1952 | if self._CheckForImmutableRevision(): |
| 1953 | print('Skipped fetching project %s (already have persistent ref)' | ||
| 1954 | % self.name) | ||
| 1953 | return True | 1955 | return True |
| 1954 | if is_sha1 and not depth: | 1956 | if is_sha1 and not depth: |
| 1955 | # When syncing a specific commit and --depth is not set: | 1957 | # When syncing a specific commit and --depth is not set: |
| @@ -2105,7 +2107,7 @@ class Project(object): | |||
| 2105 | # We just synced the upstream given branch; verify we | 2107 | # We just synced the upstream given branch; verify we |
| 2106 | # got what we wanted, else trigger a second run of all | 2108 | # got what we wanted, else trigger a second run of all |
| 2107 | # refs. | 2109 | # refs. |
| 2108 | if not self._CheckForSha1(): | 2110 | if not self._CheckForImmutableRevision(): |
| 2109 | if current_branch_only and depth: | 2111 | if current_branch_only and depth: |
| 2110 | # Sync the current branch only with depth set to None | 2112 | # Sync the current branch only with depth set to None |
| 2111 | return self._RemoteFetch(name=name, | 2113 | return self._RemoteFetch(name=name, |
