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
ea7269e4
Commit
ea7269e4
authored
May 31, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove entry variable
parent
0c7dd30c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
lib/gitlab/git/repository.rb
lib/gitlab/git/repository.rb
+9
-10
No files found.
lib/gitlab/git/repository.rb
View file @
ea7269e4
...
@@ -1006,40 +1006,39 @@ module Gitlab
...
@@ -1006,40 +1006,39 @@ module Gitlab
# Parses the contents of a .gitmodules file and returns a hash of
# Parses the contents of a .gitmodules file and returns a hash of
# submodule information.
# submodule information.
def
parse_gitmodules
(
commit
,
content
)
def
parse_gitmodules
(
commit
,
content
)
result
s
=
{}
module
s
=
{}
name
=
nil
name
=
nil
entry
=
nil
content
.
each_line
do
|
line
|
content
.
each_line
do
|
line
|
case
line
.
strip
case
line
.
strip
when
/\A\[submodule "(?<name>[^"]+)"\]\z/
# Submodule header
when
/\A\[submodule "(?<name>[^"]+)"\]\z/
# Submodule header
name
=
$~
[
:name
]
name
=
$~
[
:name
]
entry
=
result
s
[
name
]
=
{}
module
s
[
name
]
=
{}
when
/\A(?<key>\w+)\s*=\s*(?<value>.*)\z/
# Key/value pair
when
/\A(?<key>\w+)\s*=\s*(?<value>.*)\z/
# Key/value pair
key
=
$~
[
:key
]
key
=
$~
[
:key
]
value
=
$~
[
:value
].
chomp
value
=
$~
[
:value
].
chomp
next
unless
name
&&
entry
next
unless
name
&&
modules
[
name
]
entry
[
key
]
=
value
modules
[
name
]
[
key
]
=
value
if
key
==
'path'
if
key
==
'path'
begin
begin
entry
[
'id'
]
=
blob_content
(
commit
,
value
)
modules
[
name
]
[
'id'
]
=
blob_content
(
commit
,
value
)
rescue
InvalidBlobName
rescue
InvalidBlobName
# The current entry is invalid
# The current entry is invalid
result
s
.
delete
(
name
)
module
s
.
delete
(
name
)
name
=
entry
=
nil
name
=
nil
end
end
end
end
when
/\A#/
# Comment
when
/\A#/
# Comment
next
next
else
# Invalid line
else
# Invalid line
name
=
entry
=
nil
name
=
nil
end
end
end
end
result
s
module
s
end
end
# Returns true if +commit+ introduced changes to +path+, using commit
# Returns true if +commit+ introduced changes to +path+, using commit
...
...
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