diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-05-30 16:19:29 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-05-30 16:19:36 -0500 |
commit | 0c7dd30c78043ea3d4629e1e5739ccfcc7d968fe (patch) | |
tree | d6224aa797b5dd43f9f5d39c2e1c347990a1703e /spec | |
parent | 8039b9c3c6caedc19e0e44d086a007e8975134b7 (diff) | |
download | gitlab-ce-0c7dd30c78043ea3d4629e1e5739ccfcc7d968fe.tar.gz |
Make .gitmodules parsing more resilient to syntax errors
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/git/repository_spec.rb | 13 |
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 |