Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit 31ced64

Browse files
committed
refactor: переименовал output(2,3) в осмысленные названия
1 parent 98c54c7 commit 31ced64

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Common/GitRepository.cs

+11-8
Original file line numberDiff line numberDiff line change
@@ -97,28 +97,31 @@ public CurrentTreeish CurrentLocalTreeish()
9797
{
9898
logger.LogInformation($"{"[" + ModuleName + "]",-30}Getting current treeish");
9999

100-
var (exitCode, output, _) = shellRunner.RunInDirectory(RepoPath, "git rev-parse --abbrev-ref HEAD");
100+
var (exitCode, branchName, _) = shellRunner.RunInDirectory(RepoPath, "git rev-parse --abbrev-ref HEAD");
101101

102-
output = output.Trim();
103-
if (output != "HEAD")
104-
return new CurrentTreeish(TreeishType.Branch, output);
102+
branchName = branchName.Trim();
103+
if (branchName != "HEAD")
104+
return new CurrentTreeish(TreeishType.Branch, branchName);
105105

106106
if (exitCode != 0)
107107
{
108108
return new CurrentTreeish(TreeishType.Branch, "master");
109109
}
110110

111111
// todo(dstarasov): не проверяется exitCode
112-
var (_, output2, _) = shellRunner.RunInDirectory(RepoPath, "git describe --tags --exact-match");
113-
var tags = output2.Trim();
112+
var (_, tags, _) = shellRunner.RunInDirectory(RepoPath, "git describe --tags --exact-match");
113+
tags = tags.Trim();
114+
114115
if (tags.Length > 0)
115116
{
116117
return new CurrentTreeish(TreeishType.Tag, tags);
117118
}
118119

119120
// todo(dstarasov): не проверяется exitCode
120-
var (_, output3, _) = shellRunner.RunInDirectory(RepoPath, "git rev-parse HEAD");
121-
return new CurrentTreeish(TreeishType.CommitHash, output3.Trim());
121+
var (_, commitHash, _) = shellRunner.RunInDirectory(RepoPath, "git rev-parse HEAD");
122+
commitHash = commitHash.Trim();
123+
124+
return new CurrentTreeish(TreeishType.CommitHash, commitHash);
122125
}
123126

124127
public string SafeGetCurrentLocalCommitHash(string treeish = null)

0 commit comments

Comments
 (0)