Class: Avmtrf1::Git::PushLarge::LfsCommit

Inherits:
Object
  • Object
show all
Includes:
EacRubyUtils::Console::Speaker, EacRubyUtils::SimpleCache
Defined in:
lib/avmtrf1/git/push_large/lfs_commit.rb,
lib/avmtrf1/git/push_large/lfs_commit/_cache.rb,
lib/avmtrf1/git/push_large/lfs_commit/_04_push.rb,
lib/avmtrf1/git/push_large/lfs_commit/_helpers.rb,
lib/avmtrf1/git/push_large/lfs_commit/_03_commit_changes.rb,
lib/avmtrf1/git/push_large/lfs_commit/_02_track_large_files.rb,
lib/avmtrf1/git/push_large/lfs_commit/_00_checkout_previous_revision.rb,
lib/avmtrf1/git/push_large/lfs_commit/_01_cherry_pick_source_revision.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source_commit, lfs_file_min_size) ⇒ LfsCommit

Returns a new instance of LfsCommit.



16
17
18
19
20
21
# File 'lib/avmtrf1/git/push_large/lfs_commit.rb', line 16

def initialize(source_commit, lfs_file_min_size)
  @source_commit = source_commit
  @lfs_file_min_size = lfs_file_min_size
  @tracked_files = 0
  @commit = nil
end

Instance Attribute Details

#lfs_file_min_sizeObject (readonly)

Returns the value of attribute lfs_file_min_size.



14
15
16
# File 'lib/avmtrf1/git/push_large/lfs_commit.rb', line 14

def lfs_file_min_size
  @lfs_file_min_size
end

#source_commitObject (readonly)

Returns the value of attribute source_commit.



14
15
16
# File 'lib/avmtrf1/git/push_large/lfs_commit.rb', line 14

def source_commit
  @source_commit
end

#tracked_filesObject (readonly)

Returns the value of attribute tracked_files.



14
15
16
# File 'lib/avmtrf1/git/push_large/lfs_commit.rb', line 14

def tracked_files
  @tracked_files
end

Instance Method Details

#commitAvm::Git::Commit

Returns:

  • (Avm::Git::Commit)


8
9
10
11
# File 'lib/avmtrf1/git/push_large/lfs_commit/_03_commit_changes.rb', line 8

def commit
  commit_changes
  @commit
end

#fs_cache_uncachedObject



7
8
9
# File 'lib/avmtrf1/git/push_large/lfs_commit/_cache.rb', line 7

def fs_cache_uncached
  source_commit.fs_cache.child(lfs_file_min_size.present? ? lfs_file_min_size : 'nil')
end

#push_ok?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/avmtrf1/git/push_large/lfs_commit.rb', line 23

def push_ok?
  push_ok
end

#start_bannerObject



27
28
29
30
# File 'lib/avmtrf1/git/push_large/lfs_commit.rb', line 27

def start_banner
  infov '  * LFS push', "revision: #{source_revision}" \
    ", lfs_file_min_size: #{PushLarge.bytes_size(lfs_file_min_size)}"
end