Skip to content

Commit 861c171

Browse files
committed
Added pruning to fetch calls
1 parent c62aac2 commit 861c171

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020
- Fixed git path configuration (#463)
2121
- Added feedback to settings page (#550)
2222
- Fix "Home" navigation to point to current namespace (#548)
23+
- Make sure more fetch calls prune the remote branches (#471)
2324

2425
## [2.6.0] - 2024-10-07
2526

cls/SourceControl/Git/Utils.cls

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ ClassMethod Push(remote As %String = "origin", force As %Boolean = 0) As %Status
561561

562562
ClassMethod Fetch(ByRef diffFiles) As %Status
563563
{
564-
do ..RunGitCommand("fetch", .errStream, .outStream)
564+
do ..RunGitCommand("fetch", .errStream, .outStream, "--prune")
565565
write !, "Fetch done"
566566
kill errStream, outStream
567567
do ..RunGitCommand("diff", .errStream, .outStream, "..origin/"_..GetCurrentBranch(), "--name-only")
@@ -1837,7 +1837,7 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
18371837
set diffBase = ..GetCurrentBranch()
18381838
}
18391839

1840-
do ..RunGitCommand("fetch", .errorStream, .outputStream)
1840+
do ..RunGitCommand("fetch", .errorStream, .outputStream,"--prune")
18411841
kill errorStream, outputStream
18421842
do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("diff",,.errorStream,.outputStream, diffBase_$Case(diffCompare,"":"",:"..")_diffCompare, "--name-status")
18431843
do ..ParseDiffStream(outputStream,,.files)

git-webui/release/share/git-webui/webui/js/git-webui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
761761
if(branchType === "remote"){
762762
var remoteName = refName.split("/")[0];
763763
var branchName = refName.split("/")[1];
764-
webui.git("fetch "+remoteName+" "+branchName);
764+
webui.git("fetch --prune"+remoteName+" "+branchName);
765765
webui.git("branch -l "+branchName, function(existingBranch) {
766766
if (existingBranch.length > 0) {
767767
webui.git("checkout " +branchName, updateSideBar);
@@ -782,7 +782,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
782782
}
783783
else{
784784
if(branchType === "remote"){
785-
webui.git("fetch "+remoteName+" "+branchName);
785+
webui.git("fetch --prune"+remoteName+" "+branchName);
786786
webui.git("branch -l "+branchName, function(existingBranch) {
787787
if (existingBranch.length > 0) {
788788
webui.git("checkout " +branchName, updateSideBar);
@@ -908,7 +908,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
908908
var branchName = refName.split('/')[1];
909909

910910
if(branchName){
911-
webui.git("fetch "+remoteName+" "+branchName);
911+
webui.git("fetch --prune"+remoteName+" "+branchName);
912912
}
913913

914914
function callTestMergeHandler(message){

git-webui/src/share/git-webui/webui/js/git-webui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
761761
if(branchType === "remote"){
762762
var remoteName = refName.split("/")[0];
763763
var branchName = refName.split("/")[1];
764-
webui.git("fetch "+remoteName+" "+branchName);
764+
webui.git("fetch --prune"+remoteName+" "+branchName);
765765
webui.git("branch -l "+branchName, function(existingBranch) {
766766
if (existingBranch.length > 0) {
767767
webui.git("checkout " +branchName, updateSideBar);
@@ -782,7 +782,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
782782
}
783783
else{
784784
if(branchType === "remote"){
785-
webui.git("fetch "+remoteName+" "+branchName);
785+
webui.git("fetch --prune"+remoteName+" "+branchName);
786786
webui.git("branch -l "+branchName, function(existingBranch) {
787787
if (existingBranch.length > 0) {
788788
webui.git("checkout " +branchName, updateSideBar);
@@ -908,7 +908,7 @@ webui.SideBarView = function(mainView, noEventHandlers) {
908908
var branchName = refName.split('/')[1];
909909

910910
if(branchName){
911-
webui.git("fetch "+remoteName+" "+branchName);
911+
webui.git("fetch --prune"+remoteName+" "+branchName);
912912
}
913913

914914
function callTestMergeHandler(message){

0 commit comments

Comments
 (0)