summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-22 12:41:55 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-22 12:41:55 +0200
commit06feb3c44231ab3fb8ac26c00d606587ac90a11c (patch)
treef41ff92cd353ce30511024c541cf6b653abfae02
parent7f685986220349f61e7df87afda13e2ca9b8390b (diff)
downloadgitlab-ce-06feb3c44231ab3fb8ac26c00d606587ac90a11c.tar.gz
Cleanup parsed refs for git over HTTP
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--lib/gitlab/backend/grack_auth.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb
index 39ffb5f4c8d..b1f99be2cb8 100644
--- a/lib/gitlab/backend/grack_auth.rb
+++ b/lib/gitlab/backend/grack_auth.rb
@@ -125,7 +125,15 @@ module Grack
# Need to reset seek point
@request.body.rewind
- input.force_encoding('ascii-8bit').scan(/refs\/heads\/([\/\w\.-]+)/n).flatten.compact
+
+ # Parse refs
+ refs = input.force_encoding('ascii-8bit').scan(/refs\/heads\/([\/\w\.-]+)/n).flatten.compact
+
+ # Cleanup grabare from refs
+ # if push to multiple branches
+ refs.map do |ref|
+ ref.gsub(/0000PACK.*/, "")
+ end
end
end
end