summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2017-05-31 20:36:35 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2017-05-31 20:36:35 +0000
commit322c9be816cd5cd9747a8737ec04622aa6b81e6b (patch)
treeff97dc09e5d958bf7db9568a39b4461534980cb5 /spec
parentf06daa26efc127565e4e68ca9d4ac62e5a1e3b36 (diff)
parentea7269e4c66a51eb4c66b9022ba4c2b35d8ad012 (diff)
downloadgitlab-ce-322c9be816cd5cd9747a8737ec04622aa6b81e6b.tar.gz
Merge branch 'dm-gitmodules-parsing' into 'master'
Make .gitmodules parsing more resilient to syntax errors Closes #26009 See merge request !11803
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/git/repository_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/repository_spec.rb b/spec/lib/gitlab/git/repository_spec.rb
index cb107c6d1f9..9d0e95d5b19 100644
--- a/spec/lib/gitlab/git/repository_spec.rb
+++ b/spec/lib/gitlab/git/repository_spec.rb
@@ -381,6 +381,19 @@ describe Gitlab::Git::Repository, seed_helper: true do
}
])
end
+
+ it 'should not break on invalid syntax' do
+ allow(repository).to receive(:blob_content).and_return(<<-GITMODULES.strip_heredoc)
+ [submodule "six"]
+ path = six
+ url = git://github.com/randx/six.git
+
+ [submodule]
+ foo = bar
+ GITMODULES
+
+ expect(submodules).to have_key('six')
+ end
end
context 'where repo doesn\'t have submodules' do