Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d9b6fd4f
Commit
d9b6fd4f
authored
Aug 11, 2017
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle missing .gitmodules when getting submodule urls
parent
c19ea197
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
4 deletions
+16
-4
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+2
-0
spec/lib/gitlab/git/commit_spec.rb
spec/lib/gitlab/git/commit_spec.rb
+2
-2
spec/lib/gitlab/git/repository_spec.rb
spec/lib/gitlab/git/repository_spec.rb
+8
-2
spec/support/gitlab-git-test.git/objects/3e/20715310a699808282e772720b9c04a0696bcc
...est.git/objects/3e/20715310a699808282e772720b9c04a0696bcc
+0
-0
spec/support/gitlab-git-test.git/objects/95/96bc54a6f0c0c98248fe97077eb5ccf48a98d0
...est.git/objects/95/96bc54a6f0c0c98248fe97077eb5ccf48a98d0
+2
-0
spec/support/gitlab-git-test.git/packed-refs
spec/support/gitlab-git-test.git/packed-refs
+1
-0
spec/support/seed_repo.rb
spec/support/seed_repo.rb
+1
-0
No files found.
lib/gitlab/git/repository.rb
View file @
d9b6fd4f
...
...
@@ -827,6 +827,8 @@ module Gitlab
return
unless
commit_object
&&
commit_object
.
type
==
:COMMIT
gitmodules
=
gitaly_commit_client
.
tree_entry
(
ref
,
'.gitmodules'
,
Gitlab
::
Git
::
Blob
::
MAX_DATA_DISPLAY_SIZE
)
return
unless
gitmodules
found_module
=
GitmodulesParser
.
new
(
gitmodules
.
data
).
parse
[
path
]
found_module
&&
found_module
[
'url'
]
...
...
spec/lib/gitlab/git/commit_spec.rb
View file @
d9b6fd4f
...
...
@@ -310,8 +310,8 @@ describe Gitlab::Git::Commit, seed_helper: true do
commits
.
map
(
&
:id
)
end
it
'has 3
3
elements'
do
expect
(
subject
.
size
).
to
eq
(
3
3
)
it
'has 3
4
elements'
do
expect
(
subject
.
size
).
to
eq
(
3
4
)
end
it
'includes the expected commits'
do
...
...
spec/lib/gitlab/git/repository_spec.rb
View file @
d9b6fd4f
...
...
@@ -289,7 +289,13 @@ describe Gitlab::Git::Repository, seed_helper: true do
it
{
expect
(
submodule_url
(
'six'
)).
to
eq
(
'git://github.com/randx/six.git'
)
}
end
context
'no submodules at commit'
do
context
'no .gitmodules at commit'
do
let
(
:ref
)
{
'9596bc54a6f0c0c98248fe97077eb5ccf48a98d0'
}
it
{
expect
(
submodule_url
(
'six'
)).
to
eq
(
nil
)
}
end
context
'no gitlink entry'
do
let
(
:ref
)
{
'6d39438'
}
it
{
expect
(
submodule_url
(
'six'
)).
to
eq
(
nil
)
}
...
...
@@ -986,7 +992,7 @@ describe Gitlab::Git::Repository, seed_helper: true do
describe
'#branch_count'
do
it
'returns the number of branches'
do
expect
(
repository
.
branch_count
).
to
eq
(
9
)
expect
(
repository
.
branch_count
).
to
eq
(
10
)
end
end
...
...
spec/support/gitlab-git-test.git/objects/3e/20715310a699808282e772720b9c04a0696bcc
0 → 100644
View file @
d9b6fd4f
File added
spec/support/gitlab-git-test.git/objects/95/96bc54a6f0c0c98248fe97077eb5ccf48a98d0
0 → 100644
View file @
d9b6fd4f
xOn1䜯 9&O "noYD6ՒҪ?j;wQ GrN(HPrArR7tpM#McNrsI
%p>۫pz?Y3XBB̰GB4 p?kv۞y~W])[a<CP_
\ No newline at end of file
spec/support/gitlab-git-test.git/packed-refs
View file @
d9b6fd4f
...
...
@@ -8,6 +8,7 @@
46e1395e609395de004cacd4b142865ab0e52a29 refs/heads/gitattributes-updated
4b4918a572fa86f9771e5ba40fbd48e1eb03e2c6 refs/heads/master
5937ac0a7beb003549fc5fd26fc247adbce4a52e refs/heads/merge-test
9596bc54a6f0c0c98248fe97077eb5ccf48a98d0 refs/heads/missing-gitmodules
f4e6814c3e4e7a0de82a9e7cd20c626cc963a2f8 refs/tags/v1.0.0
^6f6d7e7ed97bb5f0054f2b1df789b39ca89b6ff9
8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b refs/tags/v1.1.0
...
...
spec/support/seed_repo.rb
View file @
d9b6fd4f
...
...
@@ -97,6 +97,7 @@ module SeedRepo
gitattributes-updated
master
merge-test
missing-gitmodules
]
.
freeze
TAGS
=
%w[
v1.0.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment