Skip to content

Commit 25c9841

Browse files
igoravlIgor Abade V. Leite
authored andcommitted
Fix Get-TfsGitItem (#251)
* Fix Commit version assignment in GetGitItem Updated the version assignment in the GetGitItem class to use the Commit property instead of converting the item to a string. This change ensures that the correct commit version is retrieved when using the "Get by commit SHA" parameter set. * Update release notes * Change the Commit property to string ---------
1 parent eded47e commit 25c9841

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

CSharp/TfsCmdlets/Cmdlets/Git/Item/GetGitItem.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ partial class GetGitItem
2323
/// Specifies the hash (SHA) representing the version of the item(s) to retrieve.
2424
/// </summary>
2525
[Parameter(ParameterSetName = "Get by commit SHA")]
26-
public object Commit { get; set; }
26+
public string Commit { get; set; }
2727

2828
/// <summary>
2929
/// Specifies the tag representing the version of the item(s) to retrieve.
@@ -81,7 +81,7 @@ protected override IEnumerable Run()
8181
"Get by commit SHA" => new GitVersionDescriptor()
8282
{
8383
VersionType = GitVersionType.Commit,
84-
Version = item.ToString()
84+
Version = Commit
8585
},
8686
"Get by tag" => new GitVersionDescriptor()
8787
{

Docs/ReleaseNotes/2.9.2.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# TfsCmdlets Release Notes
2+
3+
## Version 2.9.2 (_30/Jul/2025_)
4+
5+
This release fixes a bug in Get-TfsGitItem cmdlet.
6+
7+
## Fixes
8+
9+
- **`Get-TfsGitItem`**: Fixed an issue where the cmdlet would fail when specifying a commit SHA.

RELEASENOTES.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
# TfsCmdlets Release Notes
22

3-
## Version 2.9.1 (_05/Jun/2025_)
3+
## Version 2.9.2 (_30/Jul/2025_)
44

5-
This release fixes a critical bug in Set-TfsWorkItem, among other improvements.
5+
This release fixes a bug in Get-TfsGitItem cmdlet.
66

77
## Fixes
88

9-
- **`Get-TfsVersion`**: Adds support for Azure DevOps Services version "20" (currently mapped to 2022)
10-
- **`Remove-TfsTeamProject`**: Removes a double-confirmation prompt when using the `-Hard` switch, simplifying the deletion process
11-
- **`Set-TfsWorkItem`**: Fixed an issue where the actual work item ID wasn't being used when retrieving work item type information, causing some field updates to fail
9+
- **`Get-TfsGitItem`**: Fixed an issue where the cmdlet would fail when specifying a commit SHA.
1210

1311
-----------------------
1412

1513
## Previous Versions
1614

15+
## Version 2.9.1 (_05/Jun/2025_)
16+
17+
See release notes [here](Docs/ReleaseNotes/2.9.1.md).
18+
1719
## Version 2.9.0 (_15/Aug/2024_)
1820

1921
See release notes [here](Docs/ReleaseNotes/2.9.0.md).

0 commit comments

Comments
 (0)