diff options
| author | Mike Frysinger <vapier@google.com> | 2019-08-07 17:19:24 -0400 |
|---|---|---|
| committer | Mike Frysinger <vapier@google.com> | 2019-08-08 05:07:31 +0000 |
| commit | a850ca2712b61cd820a9138c9e97f3fbb583e509 (patch) | |
| tree | 0ba9843537bec95dd6d7cdfbbb644faba72e27e0 /subcmds/sync.py | |
| parent | a34186e4813170f3c71ec51c740cd571c79e12b5 (diff) | |
| download | git-repo-a850ca2712b61cd820a9138c9e97f3fbb583e509.tar.gz | |
rebase/sync: use exit(1) for errors instead of exit(-1)
Callers don't actually see -1 (they'll usually see 255, but the exact
answer here is complicated). Just switch to 1 as that's the standard
value tools use to indicate an error.
Change-Id: Ib712db1924bc3e5f7920bafd7bb5fb61f3bda44f
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233553
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'subcmds/sync.py')
| -rw-r--r-- | subcmds/sync.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index a66dd6cd..3b4c23c5 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -635,7 +635,7 @@ later is required to fix a server side protocol bug. | |||
| 635 | print('Failed to remove %s (%s)' % (os.path.join(path, '.git'), str(e)), file=sys.stderr) | 635 | print('Failed to remove %s (%s)' % (os.path.join(path, '.git'), str(e)), file=sys.stderr) |
| 636 | print('error: Failed to delete obsolete path %s' % path, file=sys.stderr) | 636 | print('error: Failed to delete obsolete path %s' % path, file=sys.stderr) |
| 637 | print(' remove manually, then run sync again', file=sys.stderr) | 637 | print(' remove manually, then run sync again', file=sys.stderr) |
| 638 | return -1 | 638 | return 1 |
| 639 | 639 | ||
| 640 | # Delete everything under the worktree, except for directories that contain | 640 | # Delete everything under the worktree, except for directories that contain |
| 641 | # another git project | 641 | # another git project |
| @@ -669,7 +669,7 @@ later is required to fix a server side protocol bug. | |||
| 669 | if failed: | 669 | if failed: |
| 670 | print('error: Failed to delete obsolete path %s' % path, file=sys.stderr) | 670 | print('error: Failed to delete obsolete path %s' % path, file=sys.stderr) |
| 671 | print(' remove manually, then run sync again', file=sys.stderr) | 671 | print(' remove manually, then run sync again', file=sys.stderr) |
| 672 | return -1 | 672 | return 1 |
| 673 | 673 | ||
| 674 | # Try deleting parent dirs if they are empty | 674 | # Try deleting parent dirs if they are empty |
| 675 | project_dir = path | 675 | project_dir = path |
| @@ -726,9 +726,9 @@ later is required to fix a server side protocol bug. | |||
| 726 | 'are present' % project.relpath, file=sys.stderr) | 726 | 'are present' % project.relpath, file=sys.stderr) |
| 727 | print(' commit changes, then run sync again', | 727 | print(' commit changes, then run sync again', |
| 728 | file=sys.stderr) | 728 | file=sys.stderr) |
| 729 | return -1 | 729 | return 1 |
| 730 | elif self._DeleteProject(project.worktree): | 730 | elif self._DeleteProject(project.worktree): |
| 731 | return -1 | 731 | return 1 |
| 732 | 732 | ||
| 733 | new_project_paths.sort() | 733 | new_project_paths.sort() |
| 734 | fd = open(file_path, 'w') | 734 | fd = open(file_path, 'w') |
