diff options
author | Ruben Davila <rdavila84@gmail.com> | 2016-09-14 10:14:49 -0500 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-09-14 10:14:49 -0500 |
commit | 9522d3129ea7d62956bbf130e171872d1e180ac6 (patch) | |
tree | dd203d806391b7106f2a8d996df251a9b710ab36 /app/models/repository.rb | |
parent | 58a343ab4bd900a7eaabdb909af67bfa5ac21f1a (diff) | |
parent | 1c05302b3c3b1cff435d3c8617e219ccc8373606 (diff) | |
download | gitlab-ce-9522d3129ea7d62956bbf130e171872d1e180ac6.tar.gz |
Merge branch 'master' into 8-12-stable
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r-- | app/models/repository.rb | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb index 3c354c25c6f..c69e5a22a69 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -990,37 +990,6 @@ class Repository Gitlab::Popen.popen(args, path_to_repo).first.scrub.split(/^--$/) end - def parse_search_result(result) - ref = nil - filename = nil - basename = nil - startline = 0 - - result.each_line.each_with_index do |line, index| - if line =~ /^.*:.*:\d+:/ - ref, filename, startline = line.split(':') - startline = startline.to_i - index - extname = Regexp.escape(File.extname(filename)) - basename = filename.sub(/#{extname}$/, '') - break - end - end - - data = "" - - result.each_line do |line| - data << line.sub(ref, '').sub(filename, '').sub(/^:-\d+-/, '').sub(/^::\d+:/, '') - end - - OpenStruct.new( - filename: filename, - basename: basename, - ref: ref, - startline: startline, - data: data - ) - end - def fetch_ref(source_path, source_ref, target_ref) args = %W(#{Gitlab.config.git.bin_path} fetch --no-tags -f #{source_path} #{source_ref}:#{target_ref}) Gitlab::Popen.popen(args, path_to_repo) @@ -1048,7 +1017,7 @@ class Repository GitHooksService.new.execute(current_user, path_to_repo, oldrev, newrev, ref) do update_ref!(ref, newrev, oldrev) - + if was_empty || !target_branch # If repo was empty expire cache after_create if was_empty |