diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-06-06 10:08:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-06 10:08:40 +0200 |
commit | d33d3efff3e5aa7ac1be2c97f4dd1ac2190f00e2 (patch) | |
tree | d17ac93f9f75d81410389e255af854f7b2aae006 /submodule_test.go | |
parent | ae788cfabbc02c2f836f5d8c3cc18021a97e9a88 (diff) | |
parent | d87faeca21e6f416e88ae3d24dae58845d7487d4 (diff) | |
download | go-git-d33d3efff3e5aa7ac1be2c97f4dd1ac2190f00e2.tar.gz |
Merge pull request #848 from josephvusich/fix/cve-2018-11235
config: modules, worktree: Submodule fixes for CVE-2018-11235
Diffstat (limited to 'submodule_test.go')
-rw-r--r-- | submodule_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/submodule_test.go b/submodule_test.go index 7c97179..2c0a2ed 100644 --- a/submodule_test.go +++ b/submodule_test.go @@ -196,6 +196,21 @@ func (s *SubmoduleSuite) TestSubmodulesInit(c *C) { } } +func (s *SubmoduleSuite) TestGitSubmodulesSymlink(c *C) { + f, err := s.Worktree.Filesystem.Create("badfile") + c.Assert(err, IsNil) + defer f.Close() + + err = s.Worktree.Filesystem.Remove(gitmodulesFile) + c.Assert(err, IsNil) + + err = s.Worktree.Filesystem.Symlink("badfile", gitmodulesFile) + c.Assert(err, IsNil) + + _, err = s.Worktree.Submodules() + c.Assert(err, Equals, ErrGitModulesSymlink) +} + func (s *SubmoduleSuite) TestSubmodulesStatus(c *C) { sm, err := s.Worktree.Submodules() c.Assert(err, IsNil) |