From 733b343ac521ffaa332b616cb2b2c7f9bbe929f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Fri, 8 Dec 2023 19:49:19 +0100 Subject: [PATCH] Improve isRemoteRef: check --- .../SqueakWorkingCopy.class/instance/isRemoteRef..st | 3 ++- .../SqueakWorkingCopy.class/instance/splitRemoteRef..st | 1 - .../SqueakWorkingCopy.class/methodProperties.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/isRemoteRef..st b/src/Squot.package/SqueakWorkingCopy.class/instance/isRemoteRef..st index 6c4007f2b..a3c46d015 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/instance/isRemoteRef..st +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/isRemoteRef..st @@ -1,3 +1,4 @@ refs isRemoteRef: aString - ^ aString beginsWith: self remoteRefBaseName \ No newline at end of file + ^ (aString beginsWith: self remoteRefBaseName) + and: [(aString occurrencesOf: $/) >= ((self remoteRefBaseName occurrencesOf: $/) + 1)] \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/instance/splitRemoteRef..st b/src/Squot.package/SqueakWorkingCopy.class/instance/splitRemoteRef..st index e6d125e5a..0756450ce 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/instance/splitRemoteRef..st +++ b/src/Squot.package/SqueakWorkingCopy.class/instance/splitRemoteRef..st @@ -4,7 +4,6 @@ splitRemoteRef: aString self assert: (self isRemoteRef: aString) description: aString, ' is not a remote ref'. parts := aString allButFirst: self remoteRefBaseName size. index := parts indexOf: $/. - self assert: index >= 1 description: aString, ' is not a valid remote ref'. remoteName := parts first: index - 1. remoteRef := parts allButFirst: index. ^ remoteName -> remoteRef \ No newline at end of file diff --git a/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json b/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json index 46a146dd7..263457610 100644 --- a/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json +++ b/src/Squot.package/SqueakWorkingCopy.class/methodProperties.json @@ -88,7 +88,7 @@ "isImageClean" : "mad 11/7/2023 15:17", "isReferencedByHead:" : "mad 10/16/2023 22:52", "isRegistered" : "mad 9/19/2023 13:49", - "isRemoteRef:" : "mad 11/29/2023 16:08", + "isRemoteRef:" : "mad 12/8/2023 19:47", "isSomeHead:" : "mad 10/16/2023 22:53", "isSqueakBranchRef:" : "mad 6/4/2023 16:10", "isSqueakRef:" : "mad 9/18/2023 13:58", @@ -134,7 +134,7 @@ "serializeChangeSets:onCommit:" : "mad 9/20/2023 12:45", "setUpstreamRemoteName:andRef:for:" : "mad 9/18/2023 20:01", "setUpstreamRemoteNameAndRef:for:" : "mad 12/8/2023 19:31", - "splitRemoteRef:" : "mad 12/8/2023 19:28", + "splitRemoteRef:" : "mad 12/8/2023 19:45", "unitOfWork" : "mad 6/3/2023 14:15", "unmappedReferencesIn:do:" : "mad 10/21/2023 23:37", "unregister" : "mad 9/19/2023 12:07",