Skip to content

Commit acddd30

Browse files
committed
feat: sync on restore/stash as well
1 parent e2cf1c9 commit acddd30

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cls/SourceControl/Git/Utils.cls

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,18 +1633,23 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
16331633
set diffBase = ""
16341634
set diffCompare = ""
16351635

1636-
if (command = "checkout"){
1636+
if (command = "checkout") {
16371637
set syncIrisWithDiff = 1
16381638
if $data(args) && $data(args(args),diffCompare) {
16391639
// no-op
16401640
}
1641-
} elseif (command = "merge") || (command = "rebase") || (command = "pull"){
1641+
} elseif (command = "restore") {
1642+
// Leave diffCompare empty, this actually does the right thing.
1643+
set syncIrisWithDiff = 1
1644+
} elseif (command = "merge") || (command = "rebase") || (command = "pull") {
16421645
set syncIrisWithCommand = 1
16431646
if $data(args) && $data(args(args),diffCompare) {
16441647
// no-op
16451648
}
16461649
}
16471650

1651+
// WebUI prefixes with "color.ui=true" so we need to grab the command
1652+
// from later in the args... array
16481653
for i=1:1:$get(args) {
16491654
if ($data(args(i))) {
16501655
set newArgs($increment(newArgs)) = args(i)
@@ -1655,6 +1660,9 @@ ClassMethod RunGitCommandWithInput(command As %String, inFile As %String = "", O
16551660
if args = (i + 2) {
16561661
set diffBase = args(i + 2)
16571662
}
1663+
} elseif (args(i) = "restore") || (args(i) = "stash") {
1664+
set syncIrisWithDiff = 1
1665+
set diffCompare = ""
16581666
} elseif (args(i) = "merge") || (args(i) = "rebase") || (args(i) = "pull") {
16591667
set syncIrisWithCommand = 1
16601668
set diffCompare = args(i + 1)

0 commit comments

Comments
 (0)