Class: Mbeditor::GitCombinedDiffService
- Inherits:
-
Object
- Object
- Mbeditor::GitCombinedDiffService
- Includes:
- GitService
- Defined in:
- app/services/mbeditor/git_combined_diff_service.rb
Constant Summary collapse
- MAX_DIFF_BYTES =
Response-size bound for pathological diffs (e.g. a committed lockfile regeneration). Truncated at the last complete per-file diff boundary so the output remains a parseable diff document.
5 * 1024 * 1024
Constants included from GitService
Mbeditor::GitService::SAFE_GIT_REF
Instance Attribute Summary collapse
-
#repo_path ⇒ Object
readonly
Returns the value of attribute repo_path.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(repo_path:, scope:) ⇒ GitCombinedDiffService
constructor
A new instance of GitCombinedDiffService.
Methods included from GitService
ahead_behind, current_branch, find_branch_base, parse_git_log, parse_git_log_with_parents, parse_name_status, parse_numstat, parse_porcelain_status, resolve_path, run_git, upstream_branch
Constructor Details
#initialize(repo_path:, scope:) ⇒ GitCombinedDiffService
Returns a new instance of GitCombinedDiffService.
14 15 16 17 |
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 14 def initialize(repo_path:, scope:) @repo_path = repo_path.to_s @scope = scope end |
Instance Attribute Details
#repo_path ⇒ Object (readonly)
Returns the value of attribute repo_path.
12 13 14 |
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 12 def repo_path @repo_path end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
12 13 14 |
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 12 def scope @scope end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 |
# File 'app/services/mbeditor/git_combined_diff_service.rb', line 19 def call return local_diff if scope == :local branch_diff end |