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

assert_git_object_type.rb « testdata « operations « service « internal - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2e1be4b09d253ac2cd6e8a339e63fe2acb970380 (plain)
1
2
3
4
5
6
7
8
def assert_git_object_type!(oid, expected_type)
  out = IO.popen(%W[git cat-file -t #{oid}], &:read)
  abort 'cat-file failed' unless $?.success?

  unless out.chomp == expected_type
    abort "error: expected #{expected_type} object, got #{out}"
  end
end