diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-22 12:41:55 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-11-22 12:41:55 +0200 |
commit | 06feb3c44231ab3fb8ac26c00d606587ac90a11c (patch) | |
tree | f41ff92cd353ce30511024c541cf6b653abfae02 | |
parent | 7f685986220349f61e7df87afda13e2ca9b8390b (diff) | |
download | gitlab-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.rb | 10 |
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 |