getCommitsBetween method

Future<List<String>> getCommitsBetween(
  1. String localCheckoutDirectory,
  2. String firstTag,
  3. String secondTag
)

Executes the git command

git rev-list oneTag anotherTag

in order to fetch all the commits done between two tags. In case of success, will return a list with a commit hash on each position, whereas in case of failure will return an empty list.

Implementation

Future<List<String>> getCommitsBetween(
    String localCheckoutDirectory, String firstTag, String secondTag) async {
  String rawResult = "";

  ProcessResult processResult = await git_service.runGit(
      ['rev-list', '$firstTag...$secondTag'],
      throwOnError: false,
      echoOutput: false,
      processWorkingDir: localCheckoutDirectory);

  rawResult =
      processResult.stdout == null ? "" : processResult.stdout.toString();
  return RwGitParser.parseGitStdoutBasedOnNewLine(rawResult);
}