Module: StashCoreAPI::Compare

Includes:
Utils
Included in:
StashCoreAPI
Defined in:
lib/stash_core_api/compare.rb

Overview

Interfaces with compare endpoints of Stash CoreAPI API

Instance Method Summary collapse

Instance Method Details

#compare_changes(from_commit, to_commit, from_repo: nil, limit: nil) ⇒ Object

Parameters:

  • from (String)

    the source commit (can be a partial/full changeset id or qualified/unqualified ref name)

  • to (String)

    the target commit (can be a partial/full changeset id or qualified/unqualified ref name)

  • fromRepo (String)

    an optional parameter specifying the source repository containing the source changeset if that changeset is not present in the current repository; the repository can be specified by either its ID fromRepo=42 or by its project key plus its repo slug separated by a slash: fromRepo=projectKey/repoSlug

  • limit (Integer) (defaults to: nil)

    the maximum number of commits to return Stash defaults to 25

See Also:



23
24
25
26
27
28
# File 'lib/stash_core_api/compare.rb', line 23

def compare_changes(from_commit, to_commit, from_repo: nil, limit: nil)
  endpoint = "/compare/changes?from=#{from_commit}&to=#{to_commit}"
  endpoint = "#{endpoint}&fromRepo=#{from_repo}" if from_repo
  endpoint = "#{endpoint}&limit=#{limit}" if limit
  perform_get(endpoint)
end