This content is part of a third party extension that is not supported by the Cake project.
For more information about this extension see
Cake.Git.
Summary
Get the short version of a commit SHA.
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