... |
... |
@@ -146,10 +146,11 @@ import shutil |
146
|
146
|
from collections.abc import Mapping
|
147
|
147
|
from io import StringIO
|
148
|
148
|
from tempfile import TemporaryFile
|
|
149
|
+import subprocess
|
149
|
150
|
|
150
|
151
|
from configparser import RawConfigParser
|
151
|
152
|
|
152
|
|
-from buildstream import Source, SourceError, Consistency, SourceFetcher
|
|
153
|
+from buildstream import Source, SourceError, Consistency, SourceFetcher, PluginError
|
153
|
154
|
from buildstream import utils
|
154
|
155
|
from buildstream.plugin import CoreWarnings
|
155
|
156
|
from buildstream.utils import move_atomic, DirectoryExistsError
|
... |
... |
@@ -227,10 +228,16 @@ class GitMirror(SourceFetcher): |
227
|
228
|
self.ensure_trackable(alias_override=alias_override)
|
228
|
229
|
return
|
229
|
230
|
|
230
|
|
- self.source.call([self.source.host_git, 'fetch', '--depth=1', 'origin', self.ref],
|
231
|
|
- cwd=tmpdir,
|
232
|
|
- fail="Failed to fetch repository",
|
233
|
|
- fail_temporarily=True)
|
|
231
|
+ exit_code, output = self.source.check_output([self.source.host_git, 'fetch', '--depth=1', 'origin', self.ref],
|
|
232
|
+ stderr=subprocess.STDOUT,
|
|
233
|
+ cwd=tmpdir)
|
|
234
|
+ if exit_code != 0:
|
|
235
|
+ import sys
|
|
236
|
+ sys.stderr.write("git error:\n")
|
|
237
|
+ sys.stderr.write(output)
|
|
238
|
+ sys.stderr.write("====")
|
|
239
|
+ raise PluginError("{plugin}: {message}".format(plugin=self, message="git fetch failed"),
|
|
240
|
+ temporary=True)
|
234
|
241
|
|
235
|
242
|
# We need to have a ref to make it clonable
|
236
|
243
|
self.source.call([self.source.host_git, 'update-ref', 'HEAD', self.ref],
|