Skip to content
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

Skip pull if remote branch does not exist #647

Merged
merged 1 commit into from
Nov 21, 2024
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 @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added saving settings as system default for new namespaces (#535)
- Added filtering through branch names in UI (#615)
- FullLoad pull event handler allows deploying changes with a full import of the repository (#619)
- Pull and Sync options no longer log a fatal error if remote branch does not exist (#562)

## [2.7.1] - 2024-11-13

Expand Down
9 changes: 7 additions & 2 deletions cls/SourceControl/Git/Utils.cls
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,15 @@ ClassMethod Pull(remote As %String = "origin", pTerminateOnError As %Boolean = 0
New %gitSCOutputFlag
Set %gitSCOutputFlag = 1
#define Force 1
do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("branch",,.errStream,.outStream,"--show-current")
set branchName = outStream.ReadLine(outStream.Size)
set branchName = ..GetCurrentBranch()
write !, "Pulling from branch: ", branchName
kill errStream, outStream
do ##class(SourceControl.Git.Utils).RunGitCommandWithInput("ls-remote",,.errStream, .outStream, remote, branchName)
if (outStream.Read() = "") {
write !, "Skipping pull because remote branch does not exist."
quit $$$OK
}
kill errStream, outStream
set returnCode = ..RunGitWithArgs(.errStream, .outStream, "pull", remote, branchName)
write !
do outStream.OutputToDevice()
Expand Down
Loading