Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • gitlab-org/gitlab_git
  • jhworth.developer/gitlab_git
  • kyrofa/gitlab_git
  • dzaporozhets/gitlab_git
  • mr-vinn/gitlab_git
  • w.haase/gitlab_git
  • mbaye.ndiaye/gitlab_git
  • tim-ringenbach/gitlab_git
  • arnecls/gitlab_git
  • stanhu/gitlab_git
  • ben.boeckel/gitlab_git
  • newton/gitlab_git
  • bcroq/gitlab_git
  • rymai/gitlab_git
  • pcarranza/gitlab_git
  • hitproger/gitlab_git
  • koreamic/gitlab_git
  • jameslopez/gitlab_git
  • bak1an/gitlab_git
  • davydovanton/gitlab_git
  • pmq20/gitlab_git
  • tmaczukin/gitlab_git
  • hiroponz/gitlab_git
  • matt-oakes/gitlab_git
  • jhund/gitlab_git
  • jaceks2106/gitlab_git
  • mknecht2405/gitlab_git
  • pacoguzman/gitlab_git
  • kevin.oconnor7/gitlab_git
  • vsizov/gitlab_git
  • razer6/gitlab_git
  • broftkd/gitlab_git
  • hwdegroot/gitlab_git
  • kolesar/gitlab_git
  • sheperson/gitlab_git
  • mrueg/gitlab_git
  • menyhartsamuel/gitlab_git
  • suguojun/gitlab_git
  • denysvitali/gitlab_git
39 results
Show changes
Commits on Source (7)
v 7.2.21
- Add checks if blob is a lfs pointer, values for size and oid.
v 7.2.20
- Switch back to GitHub Linguist and bump rugged and other gem versions
- Add method on repository to create branch
Loading
Loading
PATH
remote: .
specs:
gitlab_git (7.2.20)
gitlab_git (7.2.21)
activesupport (~> 4.0)
charlock_holmes (~> 0.7.3)
github-linguist (~> 4.7.0)
Loading
Loading
@@ -10,7 +10,7 @@ PATH
GEM
remote: http://rubygems.org/
specs:
activesupport (4.2.4)
activesupport (4.2.5)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
Loading
Loading
@@ -35,7 +35,7 @@ GEM
escape_utils (1.1.0)
ffi (1.8.1)
formatador (0.2.4)
github-linguist (4.7.0)
github-linguist (4.7.2)
charlock_holmes (~> 0.7.3)
escape_utils (~> 1.1.0)
mime-types (>= 1.19)
Loading
Loading
@@ -58,7 +58,7 @@ GEM
lumberjack (1.0.3)
method_source (0.8.1)
mime-types (1.25.1)
minitest (5.8.2)
minitest (5.8.3)
multi_json (1.10.1)
parser (2.2.0.2)
ast (>= 1.1, < 3.0)
Loading
Loading
@@ -121,3 +121,6 @@ DEPENDENCIES
rubocop
simplecov
webmock
BUNDLED WITH
1.10.6
7.2.20
7.2.21
Loading
Loading
@@ -220,6 +220,39 @@ module Gitlab
def name
encode! @name
end
# Valid LFS object pointer is a text file consisting of
# version
# oid
# size
# see https://github.com/github/git-lfs/blob/v1.1.0/docs/spec.md#the-pointer
def lfs_pointer?
has_lfs_version_key? && lfs_oid.present? && lfs_size.present?
end
def lfs_oid
if has_lfs_version_key?
oid = data.match(/(?<=sha256:)([0-9a-f]{64})/)
return oid[1] if oid
end
nil
end
def lfs_size
if has_lfs_version_key?
size = data.match(/(?<=size )([0-9]+)/)
return size[1] if size
end
nil
end
private
def has_lfs_version_key?
!empty? && text? && data.start_with?("version https://git-lfs.github.com/spec")
end
end
end
end
Loading
Loading
@@ -244,4 +244,84 @@ describe Gitlab::Git::Blob do
end.should be_false
end
end
describe :lfs_pointers do
context 'file a valid lfs pointer' do
let(:blob) do
Gitlab::Git::Blob.find(
repository,
'33bcff41c232a11727ac6d660bd4b0c2ba86d63d',
'files/lfs/image.jpg'
)
end
it { blob.lfs_pointer?.should == true }
it { blob.lfs_oid.should == "4206f951d2691c78aac4c0ce9f2b23580b2c92cdcc4336e1028742c0274938e0" }
it { blob.lfs_size.should == "19548" }
it { blob.id.should == "f4d76af13003d1106be7ac8c5a2a3d37ddf32c2a" }
it { blob.name.should == "image.jpg" }
it { blob.path.should == "files/lfs/image.jpg" }
it { blob.size.should == 130 }
it { blob.mode.should == "100644" }
end
describe 'file an invalid lfs pointer' do
context 'with correct version header but incorrect size and oid' do
let(:blob) do
Gitlab::Git::Blob.find(
repository,
'33bcff41c232a11727ac6d660bd4b0c2ba86d63d',
'files/lfs/archive-invalid.tar'
)
end
it { blob.lfs_pointer?.should == false }
it { blob.lfs_oid.should == nil }
it { blob.lfs_size.should == nil }
it { blob.id.should == "f8a898db217a5a85ed8b3d25b34c1df1d1094c46" }
it { blob.name.should == "archive-invalid.tar" }
it { blob.path.should == "files/lfs/archive-invalid.tar" }
it { blob.size.should == 43 }
it { blob.mode.should == "100644" }
end
context 'with correct version header and size but incorrect size and oid' do
let(:blob) do
Gitlab::Git::Blob.find(
repository,
'33bcff41c232a11727ac6d660bd4b0c2ba86d63d',
'files/lfs/picture-invalid.png'
)
end
it { blob.lfs_pointer?.should == false }
it { blob.lfs_oid.should == nil }
it { blob.lfs_size.should == "1575078" }
it { blob.id.should == "5ae35296e1f95c1ef9feda1241477ed29a448572" }
it { blob.name.should == "picture-invalid.png" }
it { blob.path.should == "files/lfs/picture-invalid.png" }
it { blob.size.should == 57 }
it { blob.mode.should == "100644" }
end
context 'with correct version header and size but invalid size and oid' do
let(:blob) do
Gitlab::Git::Blob.find(
repository,
'33bcff41c232a11727ac6d660bd4b0c2ba86d63d',
'files/lfs/file-invalid.zip'
)
end
it { blob.lfs_pointer?.should == false }
it { blob.lfs_oid.should == nil }
it { blob.lfs_size.should == nil }
it { blob.id.should == "d831981bd876732b85a1bcc6cc01210c9f36248f" }
it { blob.name.should == "file-invalid.zip" }
it { blob.path.should == "files/lfs/file-invalid.zip" }
it { blob.size.should == 60 }
it { blob.mode.should == "100644" }
end
end
end
end