Skip to content

Commit c3b9a95

Browse files
committed
now skips over files in other git enabled packages when performing RefreshUncommitted
1 parent cc30c44 commit c3b9a95

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
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
### Added
1111
- Items mapped from database other than namespace's default routine database are now ignored by default when exporting or adding files
1212
- New setting to configure whether mapped items should be should be treated as read-only
13+
- Now skips files belonging to other git enabled packages in `##class(SourceControl.Git.Change).RefreshUncommitted()`
1314

1415
## [2.3.1] - 2024-04-30
1516

cls/SourceControl/Git/Change.cls

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,16 @@ ClassMethod RefreshUncommitted(Display = 0, IncludeRevert = 0, Output gitFiles,
128128
// Remove entries in the uncommitted queue that don't correspond to changes as tracked by git
129129
set filename="", filename=$order(tFileList(filename),1,action)
130130
while (filename'="") {
131-
Set ^mtemphw("filename", $i(^mtemphw("filename"))) = filename
132131
set examine=$select(action="add":1,action="edit":1,action="delete":1, IncludeRevert&&(action="revert"):1,1:0)
133132
if 'examine set filename=$order(tFileList(filename),1,action) continue
134133

134+
set context = ##class(SourceControl.Git.PackageManagerContext).%Get()
135+
set packageRoot = context.Package.Root
135136
set InternalName = ##class(SourceControl.Git.Utils).NameToInternalName(filename,0,0)
136-
Set ^mtemphw("internalfilename", $i(^mtemphw("internalfilename"))) = InternalName
137+
138+
// skip files belonging to other git enabled packages
139+
if ($EXTRACT(filename, 1, $LENGTH(packageRoot)) = packageRoot) continue
140+
137141

138142
if (('##class(%File).Exists(filename)) || (InternalName = "") || ((InternalName '= "") && ('$data(gitFiles(InternalName), found)) &&
139143
(($data($$$TrackedItems(InternalName))) || ##class(SourceControl.Git.Utils).NormalizeExtension($data($$$TrackedItems(InternalName)))))) {

0 commit comments

Comments
 (0)