Index: slave/skia_slave_scripts/merge_into_android.py |
diff --git a/slave/skia_slave_scripts/merge_into_android.py b/slave/skia_slave_scripts/merge_into_android.py |
index f072d86b8d5f599adf29d9c855883d10b92207ec..27ebcd1c8f1d99790d20db63d4ed9f7920c1b795 100644 |
--- a/slave/skia_slave_scripts/merge_into_android.py |
+++ b/slave/skia_slave_scripts/merge_into_android.py |
@@ -56,8 +56,18 @@ class MergeIntoAndroid(BuildStep): |
with misc.ChDir(EXTERNAL_SKIA): |
# Check to see whether there is an upstream yet. |
if not UPSTREAM_REMOTE_NAME in shell_utils.run([GIT, 'remote', 'show']): |
- shell_utils.run([GIT, 'remote', 'add', UPSTREAM_REMOTE_NAME, |
- SKIA_REPO_URL]) |
+ try: |
+ shell_utils.run([GIT, 'remote', 'add', UPSTREAM_REMOTE_NAME, |
+ SKIA_REPO_URL]) |
+ except shell_utils.CommandFailedException as e: |
+ if 'remote %s already exists' % UPSTREAM_REMOTE_NAME in e.output: |
+ # Accept this error. The upstream remote name should have been in |
+ # the output of git remote show, which would have made us skip this |
+ # redundant command anyway. |
+ print ('%s was already added. Why did it not show in git remote' |
+ ' show?' % UPSTREAM_REMOTE_NAME) |
+ else: |
+ raise e |
# Update the upstream remote. |
shell_utils.run([GIT, 'fetch', UPSTREAM_REMOTE_NAME]) |