Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-31 00:19:29 +0300
committerDouwe Maan <douwe@selenight.nl>2017-05-31 00:19:36 +0300
commit0c7dd30c78043ea3d4629e1e5739ccfcc7d968fe (patch)
treed6224aa797b5dd43f9f5d39c2e1c347990a1703e /spec
parent8039b9c3c6caedc19e0e44d086a007e8975134b7 (diff)
Make .gitmodules parsing more resilient to syntax errors
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