File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -79,16 +79,7 @@ def find_project
79
79
# Returns the Redmine Repository object we are trying to update
80
80
def find_repositories
81
81
project = find_project
82
- repositories = project . repositories . select do |repo |
83
- repo . is_a? ( Repository ::Git )
84
- end
85
-
86
- if repositories . nil? || repositories . length == 0
87
- fail (
88
- TypeError ,
89
- "Project '#{ project } ' ('#{ project . identifier } ') has no repository"
90
- )
91
- end
82
+ repositories = git_repositories ( project )
92
83
93
84
# if a specific repository id is passed in url parameter "repository_id",
94
85
# then try to find it in the list of current project repositories and use
@@ -136,6 +127,19 @@ def git_command(command)
136
127
GIT_BIN + " #{ command } "
137
128
end
138
129
130
+ def git_repositories ( project )
131
+ repositories = project . repositories . select do |repo |
132
+ repo . is_a? ( Repository ::Git )
133
+ end
134
+ if repositories . empty?
135
+ fail (
136
+ TypeError ,
137
+ "Project '#{ project } ' ('#{ project . identifier } ') has no repository"
138
+ )
139
+ end
140
+ repositories || [ ]
141
+ end
142
+
139
143
def logger
140
144
@logger || NullLogger . new
141
145
end
You can’t perform that action at this time.
0 commit comments