Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-22 14:41:55 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-11-22 14:41:55 +0400
commit06feb3c44231ab3fb8ac26c00d606587ac90a11c (patch)
treef41ff92cd353ce30511024c541cf6b653abfae02 /lib
parent7f685986220349f61e7df87afda13e2ca9b8390b (diff)
Cleanup parsed refs for git over HTTP
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib')
-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