Commit 06feb3c44231ab3fb8ac26c00d606587ac90a11c
1 parent
7f685986
Exists in
master
and in
4 other branches
Cleanup parsed refs for git over HTTP
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
1 changed file
with
9 additions
and
1 deletions
Show diff stats
lib/gitlab/backend/grack_auth.rb
| ... | ... | @@ -125,7 +125,15 @@ module Grack |
| 125 | 125 | |
| 126 | 126 | # Need to reset seek point |
| 127 | 127 | @request.body.rewind |
| 128 | - input.force_encoding('ascii-8bit').scan(/refs\/heads\/([\/\w\.-]+)/n).flatten.compact | |
| 128 | + | |
| 129 | + # Parse refs | |
| 130 | + refs = input.force_encoding('ascii-8bit').scan(/refs\/heads\/([\/\w\.-]+)/n).flatten.compact | |
| 131 | + | |
| 132 | + # Cleanup grabare from refs | |
| 133 | + # if push to multiple branches | |
| 134 | + refs.map do |ref| | |
| 135 | + ref.gsub(/0000PACK.*/, "") | |
| 136 | + end | |
| 129 | 137 | end |
| 130 | 138 | end |
| 131 | 139 | end | ... | ... |