// Spectator token
os.Setenv("ARVADOS_API_TOKEN", "zw2f4gwx8hw8cjre7yp6v1zylhrhn3m5gvjq73rtpwhmknrybu")
err := s.runGit(c, "fetch", "thisrepodoesnotexist.git")
- c.Assert(err, check.ErrorMatches, `.* not found:.*`)
+ c.Assert(err, check.ErrorMatches, `.* not found.*`)
}
func (s *IntegrationSuite) TestNoPermission(c *check.C) {
os.Setenv("ARVADOS_API_TOKEN", "4kg6k6lzmp9kj4cpkcoxie964cmvjahbt4fod9zru44k4jqdmi")
for _, repo := range []string{"foo.git", "foo/.git"} {
err := s.runGit(c, "fetch", repo)
- c.Assert(err, check.ErrorMatches, `.* not found:.*`)
+ c.Assert(err, check.ErrorMatches, `.* not found.*`)
}
}
go w.Close()
output, err := cmd.CombinedOutput()
c.Log("git ", gitargs, " => ", err)
- if err != nil {
- // Easier to match error strings without newlines.
+ if err != nil && len(output) > 0 {
+ // If messages appeared on stderr, they are more
+ // helpful than the err returned by CombinedOutput().
+ //
+ // Easier to match error strings without newlines:
err = errors.New(strings.Replace(string(output), "\n", " // ", -1))
}
return err