Skip to content
Snippets Groups Projects

Add checks if blob is a lfs pointer, values for size and oid.

Merged Marin Jankovski requested to merge lfs_blob_data into master

Depends on gitlab-org/gitlab-ce!1976

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
223
224 def lfs_pointer?
225 if !empty? && text? && data.starts_with?("version https://git-lfs.github.com/spec")
226 true
227 else
228 false
229 end
230 end
231
232 def lfs_oid
233 if lfs_pointer?
234 oid = data.match(/(?<=sha256:)([0-9a-f]{64})/)
235 return oid[1] if oid
236 end
237
238 nil
  • I don't think we should allow a situation where #lfs_pointer? is true, but #lfs_oid is nil.

    It's only a real #lfs_pointer? if it has an OID and a size, right?

  • Author Maintainer

    Indeed, covered those cases with specs and changed lfs_pointer?.

  • mentioned in merge request gitlab-git-test!6 (merged)

  • Marin Jankovski Added 1 commit:

    Added 1 commit:

    • 12d2af43 - Add blob specs for lfs blobs, refactor.
  • Marin Jankovski Added 1 commit:

    Added 1 commit:

  • Marin Jankovski Added 1 commit:

    Added 1 commit:

    • f2d08c94 - Change the name for the lfs version check method.
  • Marin Jankovski Added 1 commit:

    Added 1 commit:

  • Reassigned to @DouweM

  • Marin Jankovski Title changed from WIP | Add checks if blob is a lfs pointer, values for size and oid. to Add checks if blob is a lfs pointer, values for size and oid.

    Title changed from WIP | Add checks if blob is a lfs pointer, values for size and oid. to Add checks if blob is a lfs pointer, values for size and oid.

  • Author Maintainer

    @DouweM Removed WIP on this one and assigned it to you.

  • Douwe Maan Status changed to merged

    Status changed to merged

  • Douwe Maan mentioned in commit 260d863a

    mentioned in commit 260d863a

  • Awesome, released gitlab_git 7.2.21.

  • Please register or sign in to reply
    Loading