MCPcopy Index your code
hub / github.com/go-git/go-git / TestRepositoryRelativeURLDeepTraversal

Method TestRepositoryRelativeURLDeepTraversal

submodule_test.go:357–369  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

355}
356
357func (s *SubmoduleSuite) TestRepositoryRelativeURLDeepTraversal(c *C) {
358 sm := newSubmoduleForRelativeURL(c,
359 "https://example.invalid/group/proj.git", "basic", "../../org/X.git")
360
361 r, err := sm.Repository()
362 c.Assert(err, IsNil)
363
364 remotes, err := r.Remotes()
365 c.Assert(err, IsNil)
366 c.Assert(remotes, HasLen, 1)
367 c.Assert(remotes[0].Config().URLs[0], Equals,
368 "https://example.invalid/org/X.git")
369}
370
371func (s *SubmoduleSuite) TestRepositoryAbsoluteLocalURLPreserved(c *C) {
372 raw := "/abs/path/X.git"

Callers

nothing calls this directly

Calls 4

RepositoryMethod · 0.80
RemotesMethod · 0.80
ConfigMethod · 0.65

Tested by

no test coverage detected