Skip to content

Commit dfe5d77

Browse files
authored
Merge pull request #812 from raymond-rebbeck/fix-delete-undefined-user
Do not remove deletes from the uncommitted queue when checking item status
2 parents dbf8cd3 + 99db858 commit dfe5d77

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
1111
- Fix Import All not importing items that do not already exist when compileOnImport is not set (#798)
1212
- Import All now imports configuration file before everything else (#806)
13+
- Fixed another instance of deletes showing as owned by undefined user (#812)
1314
- Fix Revert not syncing files with IRIS (#789)
1415

1516
## [2.12.2] - 2025-07-08

cls/SourceControl/Git/Change.cls

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ ClassMethod AddDeletedToUncommitted(Filename, InternalName) As %Status
6666
Quit ..SetUncommitted(Filename, "delete", InternalName, $USERNAME, "", 1, "", "", 0)
6767
}
6868

69+
/// Determine if an item is deleted, if it is not in a provided list of git files but is a known tracked item
70+
ClassMethod IsDeleted(InternalName As %String, ByRef gitFiles) As %Boolean
71+
{
72+
Quit ('$data(gitFiles(InternalName))) && ($data($$$TrackedItems(##class(%Studio.SourceControl.Interface).normalizeName(InternalName))))
73+
}
74+
6975
/// The Filename here is an ExternalName formatted name with the full file path
7076
ClassMethod IsUncommitted(Filename, ByRef ID) As %Boolean
7177
{
@@ -151,8 +157,7 @@ ClassMethod RefreshUncommitted(Display = 0, IncludeRevert = 0, Output gitFiles,
151157

152158
if ((InternalName = "")
153159
|| ((InternalName '= "")
154-
&& ('$data(gitFiles(InternalName), found))
155-
&& ($data($$$TrackedItems(##class(%Studio.SourceControl.Interface).normalizeName(InternalName)))))) {
160+
&& ..IsDeleted(InternalName, .gitFiles))) {
156161
set sc=..RemoveUncommitted(filename,Display,0,0)
157162
if $$$ISERR(sc) continue
158163
}

cls/SourceControl/Git/Extension.cls

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,8 @@ Method GetStatus(ByRef InternalName As %String, ByRef IsInSourceControl As %Bool
529529
} else {
530530
// If it doesn't show up in git status, there are no uncommitted changes so it should not be locked or checked out by any user
531531
set Editable=1, IsCheckedOut=0, UserCheckedOut=""
532-
if ##class(SourceControl.Git.Change).IsUncommitted(filename){
532+
if ##class(SourceControl.Git.Change).IsUncommitted(filename)
533+
&& '##class(SourceControl.Git.Change).IsDeleted(InternalName, .files) {
533534
#; Remove the item from the list of uncommitted changes;
534535
set sc=##class(SourceControl.Git.Change).RemoveUncommitted(filename,1,1)
535536
if $$$ISERR(sc) write "Error removing uncommitted file "_filename_" - "_$system.OBJ.DisplayError(sc)

0 commit comments

Comments
 (0)