Skip to content

Do not remove deletes from the uncommitted queue when checking item status #812

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- Fix Import All not importing items that do not already exist when compileOnImport is not set (#798)
- Import All now imports configuration file before everything else (#806)
- Fixed another instance of deletes showing as owned by undefined user (#812)
- Fix Revert not syncing files with IRIS (#789)

## [2.12.2] - 2025-07-08
Expand Down
9 changes: 7 additions & 2 deletions cls/SourceControl/Git/Change.cls
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ ClassMethod AddDeletedToUncommitted(Filename, InternalName) As %Status
Quit ..SetUncommitted(Filename, "delete", InternalName, $USERNAME, "", 1, "", "", 0)
}

/// Determine if an item is deleted, if it is not in a provided list of git files but is a known tracked item
ClassMethod IsDeleted(InternalName As %String, ByRef gitFiles) As %Boolean
{
Quit ('$data(gitFiles(InternalName))) && ($data($$$TrackedItems(##class(%Studio.SourceControl.Interface).normalizeName(InternalName))))
}

/// The Filename here is an ExternalName formatted name with the full file path
ClassMethod IsUncommitted(Filename, ByRef ID) As %Boolean
{
Expand Down Expand Up @@ -151,8 +157,7 @@ ClassMethod RefreshUncommitted(Display = 0, IncludeRevert = 0, Output gitFiles,

if ((InternalName = "")
|| ((InternalName '= "")
&& ('$data(gitFiles(InternalName), found))
&& ($data($$$TrackedItems(##class(%Studio.SourceControl.Interface).normalizeName(InternalName)))))) {
&& ..IsDeleted(InternalName, .gitFiles))) {
set sc=..RemoveUncommitted(filename,Display,0,0)
if $$$ISERR(sc) continue
}
Expand Down
3 changes: 2 additions & 1 deletion cls/SourceControl/Git/Extension.cls
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ Method GetStatus(ByRef InternalName As %String, ByRef IsInSourceControl As %Bool
} else {
// 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
set Editable=1, IsCheckedOut=0, UserCheckedOut=""
if ##class(SourceControl.Git.Change).IsUncommitted(filename){
if ##class(SourceControl.Git.Change).IsUncommitted(filename)
&& '##class(SourceControl.Git.Change).IsDeleted(InternalName, .files) {
#; Remove the item from the list of uncommitted changes;
set sc=##class(SourceControl.Git.Change).RemoveUncommitted(filename,1,1)
if $$$ISERR(sc) write "Error removing uncommitted file "_filename_" - "_$system.OBJ.DisplayError(sc)
Expand Down
Loading