(c *C)
| 369 | } |
| 370 | |
| 371 | func (s *SubmoduleSuite) TestRepositoryAbsoluteLocalURLPreserved(c *C) { |
| 372 | raw := "/abs/path/X.git" |
| 373 | sm := newSubmoduleForRelativeURL(c, "", "basic", raw) |
| 374 | |
| 375 | r, err := sm.Repository() |
| 376 | c.Assert(err, IsNil) |
| 377 | |
| 378 | remotes, err := r.Remotes() |
| 379 | c.Assert(err, IsNil) |
| 380 | c.Assert(remotes, HasLen, 1) |
| 381 | |
| 382 | // transport.NewEndpoint -> parseFile normalizes via filepath.Abs; |
| 383 | // on Windows this prepends a drive letter. Mirror that here so the |
| 384 | // assertion is portable. The point of this test is that the |
| 385 | // relative-resolution branch is skipped for absolute inputs, not |
| 386 | // the exact form parseFile produces. |
| 387 | expected, err := filepath.Abs(raw) |
| 388 | c.Assert(err, IsNil) |
| 389 | c.Assert(remotes[0].Config().URLs[0], Equals, "file://"+expected) |
| 390 | } |
| 391 | |
| 392 | func (s *SubmoduleSuite) TestRepositoryRelativeURLNoParentRemote(c *C) { |
| 393 | sm := newSubmoduleForRelativeURL(c, "", "basic", "../X.git") |
nothing calls this directly
no test coverage detected