diff options
| author | Xin Li <delphij@google.com> | 2016-06-24 12:17:14 -0700 |
|---|---|---|
| committer | Xin Li <delphij@google.com> | 2016-06-29 11:01:43 -0700 |
| commit | f97e72e5ddfcd34400aba384775b793170044f5c (patch) | |
| tree | cd904224470fe41af46ebbf1e5894377d8d0088c | |
| parent | faaddc9b4e4c6f6cbac02e90415676fabd177b99 (diff) | |
| download | git-repo-f97e72e5ddfcd34400aba384775b793170044f5c.tar.gz | |
Bail out when manifest is referencing a bad SHA-1 revision.
BUG: Issue 222
Change-Id: Ie0a64b39922d6fdf1be2989eb514985be8490278
| -rw-r--r-- | gitc_utils.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gitc_utils.py b/gitc_utils.py index a388dc27..7a35e7a0 100644 --- a/gitc_utils.py +++ b/gitc_utils.py | |||
| @@ -24,6 +24,8 @@ import git_command | |||
| 24 | import git_config | 24 | import git_config |
| 25 | import wrapper | 25 | import wrapper |
| 26 | 26 | ||
| 27 | from error import ManifestParseError | ||
| 28 | |||
| 27 | NUM_BATCH_RETRIEVE_REVISIONID = 300 | 29 | NUM_BATCH_RETRIEVE_REVISIONID = 300 |
| 28 | 30 | ||
| 29 | def get_gitc_manifest_dir(): | 31 | def get_gitc_manifest_dir(): |
| @@ -54,7 +56,11 @@ def _set_project_revisions(projects): | |||
| 54 | if gitcmd.Wait(): | 56 | if gitcmd.Wait(): |
| 55 | print('FATAL: Failed to retrieve revisionExpr for %s' % proj) | 57 | print('FATAL: Failed to retrieve revisionExpr for %s' % proj) |
| 56 | sys.exit(1) | 58 | sys.exit(1) |
| 57 | proj.revisionExpr = gitcmd.stdout.split('\t')[0] | 59 | revisionExpr = gitcmd.stdout.split('\t')[0] |
| 60 | if not revisionExpr: | ||
| 61 | raise(ManifestParseError('Invalid SHA-1 revision project %s (%s)' % | ||
| 62 | (proj.remote.url, proj.revisionExpr))) | ||
| 63 | proj.revisionExpr = revisionExpr | ||
| 58 | 64 | ||
| 59 | def _manifest_groups(manifest): | 65 | def _manifest_groups(manifest): |
| 60 | """Returns the manifest group string that should be synced | 66 | """Returns the manifest group string that should be synced |
