diff --git a/CHANGELOG.md b/CHANGELOG.md index 94069088..ebaeb540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fix errors on commit when a file was added, never committed, then deleted from the repository (#481) - Fixed issue with saving multiple new no-folder mapping settings at the same time (#533) - Fixed sending OS error when git pull encounters error (#545) +- Fixed suppressing editing of locked classes (#301) ## [2.6.0] - 2024-10-07 diff --git a/cls/SourceControl/Git/Extension.cls b/cls/SourceControl/Git/Extension.cls index 9805b292..1b5d6ce4 100644 --- a/cls/SourceControl/Git/Extension.cls +++ b/cls/SourceControl/Git/Extension.cls @@ -59,13 +59,18 @@ Method UserAction(Type As %Integer, Name As %String, InternalName As %String, Se // if item is being edited in a different namespace, opening it will display an alert. Editing in this namespace will remove the alert. set filename = ##class(SourceControl.Git.Utils).FullExternalName(.InternalName) do ##class(SourceControl.Git.Change).GetUncommitted(filename,.tAction) + do ..GetStatus(.InternalName, .isInSourceControl, .isEditable,.isCheckedOut,.userCheckedOut) if '$data(tAction) { set user = "", inNamespace = "" - if ##class(SourceControl.Git.Utils).InstanceWideUncommittedCheck(InternalName, .user, .inNamespace) { + if 'isEditable || ##class(SourceControl.Git.Utils).Locked() { + set Target = "Warning: Attempting to edit read-only file" + write !, Target + set Action = 6 + } elseif ##class(SourceControl.Git.Utils).InstanceWideUncommittedCheck(InternalName, .user, .inNamespace) { set Target = "Warning: Item " _ InternalName _ " is currently being modified by " _ user _ " in namespace " _ inNamespace _ "." write !, Target set Action = 6 - } + } } } }