Skip to content

Commit 6177415

Browse files
authored
Merge pull request #66 from infosiftr/fetch-failures-context
Add more context to "git fetch" failures
2 parents d5c8f9a + 34166db commit 6177415

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/bashbrew/git.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,13 +254,14 @@ func (r Repo) fetchGitRepo(arch string, entry *manifest.Manifest2822Entry) (stri
254254
//Progress: os.Stdout,
255255
})
256256
if err != nil {
257-
fetchErrors = append(fetchErrors, err)
257+
fetchErrors = append(fetchErrors, fmt.Errorf("failed fetching %q: %w", fetchString, err))
258258
continue
259259
}
260260

261-
commit, err = getGitCommit(entry.ArchGitCommit(arch))
261+
archCommit := entry.ArchGitCommit(arch)
262+
commit, err = getGitCommit(archCommit)
262263
if err != nil {
263-
fetchErrors = append(fetchErrors, err)
264+
fetchErrors = append(fetchErrors, fmt.Errorf("failed finding Git commit %q after fetching %q: %w", archCommit, fetchString, err))
264265
continue
265266
}
266267

0 commit comments

Comments
 (0)