GitAliases.

GitShortenSha(ICakeContext, DirectoryPath, GitCommit, Nullable<int>) Method

Summary

Get the short version of a commit SHA.
Assembly
Cake.Git.dll
Namespace
Cake.Git
Containing Type
GitAliases

Syntax

public static string GitShortenSha(this ICakeContext context, DirectoryPath repositoryDirectoryPath, GitCommit commit, Nullable<int> minimalLength = null)

Examples

var commit = GitLogTip("path/to/repo");
var shortSha = GitShortenSha("path/to/repo", commit);

Attributes

Type Description
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext The context.
repositoryDirectoryPath DirectoryPath Path to repository.
commit GitCommit The Commit whose Sha should be shortened.
minimalLength Nullable<int> The minimal length of the shortened SHA. The default is 7 (seven) characters.

Return Value

Type Description
string