@@ -80,7 +80,7 @@ func newVcsLocalErrorOr(msg string, err error, out string) error {
80
80
}
81
81
82
82
func (r * gitRepo ) get (ctx context.Context ) error {
83
- out , err := runFromCwd (ctx , "git" , "clone" , "--recursive" , "-v" , "--progress" , r .Remote (), r .LocalPath ())
83
+ out , err := runFromCwd (ctx , expensiveCmdTimeout , "git" , "clone" , "--recursive" , "-v" , "--progress" , r .Remote (), r .LocalPath ())
84
84
if err != nil {
85
85
return newVcsRemoteErrorOr ("unable to get repository" , err , string (out ))
86
86
}
@@ -90,15 +90,15 @@ func (r *gitRepo) get(ctx context.Context) error {
90
90
91
91
func (r * gitRepo ) fetch (ctx context.Context ) error {
92
92
// Perform a fetch to make sure everything is up to date.
93
- out , err := runFromRepoDir (ctx , r , "git" , "fetch" , "--tags" , "--prune" , r .RemoteLocation )
93
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "git" , "fetch" , "--tags" , "--prune" , r .RemoteLocation )
94
94
if err != nil {
95
95
return newVcsRemoteErrorOr ("unable to update repository" , err , string (out ))
96
96
}
97
97
return nil
98
98
}
99
99
100
100
func (r * gitRepo ) updateVersion (ctx context.Context , v string ) error {
101
- out , err := runFromRepoDir (ctx , r , "git" , "checkout" , v )
101
+ out , err := runFromRepoDir (ctx , r , defaultCmdTimeout , "git" , "checkout" , v )
102
102
if err != nil {
103
103
return newVcsLocalErrorOr ("Unable to update checked out version" , err , string (out ))
104
104
}
@@ -110,20 +110,20 @@ func (r *gitRepo) updateVersion(ctx context.Context, v string) error {
110
110
// submodules. Or nested submodules. What a great idea, submodules.
111
111
func (r * gitRepo ) defendAgainstSubmodules (ctx context.Context ) error {
112
112
// First, update them to whatever they should be, if there should happen to be any.
113
- out , err := runFromRepoDir (ctx , r , "git" , "submodule" , "update" , "--init" , "--recursive" )
113
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "git" , "submodule" , "update" , "--init" , "--recursive" )
114
114
if err != nil {
115
115
return newVcsLocalErrorOr ("unexpected error while defensively updating submodules" , err , string (out ))
116
116
}
117
117
118
118
// Now, do a special extra-aggressive clean in case changing versions caused
119
119
// one or more submodules to go away.
120
- out , err = runFromRepoDir (ctx , r , "git" , "clean" , "-x" , "-d" , "-f" , "-f" )
120
+ out , err = runFromRepoDir (ctx , r , defaultCmdTimeout , "git" , "clean" , "-x" , "-d" , "-f" , "-f" )
121
121
if err != nil {
122
122
return newVcsLocalErrorOr ("unexpected error while defensively cleaning up after possible derelict submodule directories" , err , string (out ))
123
123
}
124
124
125
125
// Then, repeat just in case there are any nested submodules that went away.
126
- out , err = runFromRepoDir (ctx , r , "git" , "submodule" , "foreach" , "--recursive" , "git" , "clean" , "-x" , "-d" , "-f" , "-f" )
126
+ out , err = runFromRepoDir (ctx , r , defaultCmdTimeout , "git" , "submodule" , "foreach" , "--recursive" , "git" , "clean" , "-x" , "-d" , "-f" , "-f" )
127
127
if err != nil {
128
128
return newVcsLocalErrorOr ("unexpected error while defensively cleaning up after possible derelict nested submodule directories" , err , string (out ))
129
129
}
@@ -144,7 +144,7 @@ func (r *bzrRepo) get(ctx context.Context) error {
144
144
}
145
145
}
146
146
147
- out , err := runFromCwd (ctx , "bzr" , "branch" , r .Remote (), r .LocalPath ())
147
+ out , err := runFromCwd (ctx , expensiveCmdTimeout , "bzr" , "branch" , r .Remote (), r .LocalPath ())
148
148
if err != nil {
149
149
return newVcsRemoteErrorOr ("unable to get repository" , err , string (out ))
150
150
}
@@ -153,15 +153,15 @@ func (r *bzrRepo) get(ctx context.Context) error {
153
153
}
154
154
155
155
func (r * bzrRepo ) fetch (ctx context.Context ) error {
156
- out , err := runFromRepoDir (ctx , r , "bzr" , "pull" )
156
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "bzr" , "pull" )
157
157
if err != nil {
158
158
return newVcsRemoteErrorOr ("unable to update repository" , err , string (out ))
159
159
}
160
160
return nil
161
161
}
162
162
163
163
func (r * bzrRepo ) updateVersion (ctx context.Context , version string ) error {
164
- out , err := runFromRepoDir (ctx , r , "bzr" , "update" , "-r" , version )
164
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "bzr" , "update" , "-r" , version )
165
165
if err != nil {
166
166
return newVcsLocalErrorOr ("unable to update checked out version" , err , string (out ))
167
167
}
@@ -173,7 +173,7 @@ type hgRepo struct {
173
173
}
174
174
175
175
func (r * hgRepo ) get (ctx context.Context ) error {
176
- out , err := runFromCwd (ctx , "hg" , "clone" , r .Remote (), r .LocalPath ())
176
+ out , err := runFromCwd (ctx , expensiveCmdTimeout , "hg" , "clone" , r .Remote (), r .LocalPath ())
177
177
if err != nil {
178
178
return newVcsRemoteErrorOr ("unable to get repository" , err , string (out ))
179
179
}
@@ -182,15 +182,15 @@ func (r *hgRepo) get(ctx context.Context) error {
182
182
}
183
183
184
184
func (r * hgRepo ) fetch (ctx context.Context ) error {
185
- out , err := runFromRepoDir (ctx , r , "hg" , "pull" )
185
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "hg" , "pull" )
186
186
if err != nil {
187
187
return newVcsRemoteErrorOr ("unable to fetch latest changes" , err , string (out ))
188
188
}
189
189
return nil
190
190
}
191
191
192
192
func (r * hgRepo ) updateVersion (ctx context.Context , version string ) error {
193
- out , err := runFromRepoDir (ctx , r , "hg" , "update" , version )
193
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "hg" , "update" , version )
194
194
if err != nil {
195
195
return newVcsRemoteErrorOr ("unable to update checked out version" , err , string (out ))
196
196
}
@@ -210,7 +210,7 @@ func (r *svnRepo) get(ctx context.Context) error {
210
210
remote = "file:///" + remote
211
211
}
212
212
213
- out , err := runFromCwd (ctx , "svn" , "checkout" , remote , r .LocalPath ())
213
+ out , err := runFromCwd (ctx , expensiveCmdTimeout , "svn" , "checkout" , remote , r .LocalPath ())
214
214
if err != nil {
215
215
return newVcsRemoteErrorOr ("unable to get repository" , err , string (out ))
216
216
}
@@ -219,7 +219,7 @@ func (r *svnRepo) get(ctx context.Context) error {
219
219
}
220
220
221
221
func (r * svnRepo ) update (ctx context.Context ) error {
222
- out , err := runFromRepoDir (ctx , r , "svn" , "update" )
222
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "svn" , "update" )
223
223
if err != nil {
224
224
return newVcsRemoteErrorOr ("unable to update repository" , err , string (out ))
225
225
}
@@ -228,7 +228,7 @@ func (r *svnRepo) update(ctx context.Context) error {
228
228
}
229
229
230
230
func (r * svnRepo ) updateVersion (ctx context.Context , version string ) error {
231
- out , err := runFromRepoDir (ctx , r , "svn" , "update" , "-r" , version )
231
+ out , err := runFromRepoDir (ctx , r , expensiveCmdTimeout , "svn" , "update" , "-r" , version )
232
232
if err != nil {
233
233
return newVcsRemoteErrorOr ("unable to update checked out version" , err , string (out ))
234
234
}
@@ -250,7 +250,7 @@ func (r *svnRepo) CommitInfo(id string) (*vcs.CommitInfo, error) {
250
250
Commit commit `xml:"entry>commit"`
251
251
}
252
252
253
- out , err := runFromRepoDir (ctx , r , "svn" , "info" , "-r" , id , "--xml" )
253
+ out , err := runFromRepoDir (ctx , r , defaultCmdTimeout , "svn" , "info" , "-r" , id , "--xml" )
254
254
if err != nil {
255
255
return nil , newVcsLocalErrorOr ("unable to retrieve commit information" , err , string (out ))
256
256
}
@@ -267,7 +267,7 @@ func (r *svnRepo) CommitInfo(id string) (*vcs.CommitInfo, error) {
267
267
}
268
268
}
269
269
270
- out , err := runFromRepoDir (ctx , r , "svn" , "log" , "-r" , id , "--xml" )
270
+ out , err := runFromRepoDir (ctx , r , defaultCmdTimeout , "svn" , "log" , "-r" , id , "--xml" )
271
271
if err != nil {
272
272
return nil , newVcsRemoteErrorOr ("unable to retrieve commit information" , err , string (out ))
273
273
}
0 commit comments