From 55dc4b4c055d23a8f7fdb5fbb49e0fcab76a84a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marius=20D=C3=B6rbandt?= Date: Sat, 18 May 2024 12:27:13 +0200 Subject: [PATCH] Flush ref cache after external fetch/push --- .../instance/externalPush.toRemote.force..st | 2 +- .../instance/fetchAllExternalFrom..st | 2 +- .../instance/refsChangedExternally.st | 4 ++++ .../FileSystemGitRepository.class/methodProperties.json | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 src/FileSystem-Git.package/FileSystemGitRepository.class/instance/refsChangedExternally.st diff --git a/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/externalPush.toRemote.force..st b/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/externalPush.toRemote.force..st index ec11c91f4..893a792c8 100644 --- a/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/externalPush.toRemote.force..st +++ b/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/externalPush.toRemote.force..st @@ -4,4 +4,4 @@ externalPush: aCollectionOfBranchNamesAndAssociations toRemote: remoteName force self externalGitDo: ('push {1}{2} {3}:{4}' format: { forceBoolean ifTrue: ['-f '] ifFalse: ['']. remoteName. branch key. branch value})]. - self repository changed: #allReferences. \ No newline at end of file + self refsChangedExternally. \ No newline at end of file diff --git a/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/fetchAllExternalFrom..st b/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/fetchAllExternalFrom..st index e25499fdb..4f110eda4 100644 --- a/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/fetchAllExternalFrom..st +++ b/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/fetchAllExternalFrom..st @@ -6,6 +6,6 @@ fetchAllExternalFrom: aRemoteName self externalGitDo: ('fetch {1}{2}' format: { GitFeatureFlags pruneWhenFetching ifTrue: ['--prune '] ifFalse: ['']. aRemoteName}). - self repository changed: #allReferences. + self refsChangedExternally. url := remote url ifNil: [(GitRemoteUndefined remote: remote) signal: 'No URL configured.']. ^ (GitAbstractProtocol url: url) refs \ No newline at end of file diff --git a/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/refsChangedExternally.st b/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/refsChangedExternally.st new file mode 100644 index 000000000..4c9566eb1 --- /dev/null +++ b/src/FileSystem-Git.package/FileSystemGitRepository.class/instance/refsChangedExternally.st @@ -0,0 +1,4 @@ +git porcelain - external +refsChangedExternally + self unitOfWork flushCaches. + self repository changed: #allReferences. \ No newline at end of file diff --git a/src/FileSystem-Git.package/FileSystemGitRepository.class/methodProperties.json b/src/FileSystem-Git.package/FileSystemGitRepository.class/methodProperties.json index 08ab64da8..957a14aac 100644 --- a/src/FileSystem-Git.package/FileSystemGitRepository.class/methodProperties.json +++ b/src/FileSystem-Git.package/FileSystemGitRepository.class/methodProperties.json @@ -14,8 +14,8 @@ "expandRemoteRef:" : "pre 6/15/2018 16:04", "externalCommand:" : "mad 5/18/2024 11:18", "externalGitDo:" : "mad 12/20/2023 19:11", - "externalPush:toRemote:force:" : "mad 5/18/2024 12:25", - "fetchAllExternalFrom:" : "mad 5/15/2024 20:56", + "externalPush:toRemote:force:" : "mad 5/18/2024 12:26", + "fetchAllExternalFrom:" : "mad 5/18/2024 11:48", "fetchFrom:" : "mad 4/22/2024 17:34", "fetchFromAll:" : "mad 4/22/2024 17:25", "fetchInternalFrom:" : "mad 4/22/2024 17:24", @@ -38,6 +38,7 @@ "pushToRemote:update:deleteRemoteBranches:force:" : "mad 5/18/2024 11:27", "pushToUpstreamBranchOf:ifNone:" : "jr 3/4/2020 00:49", "recursivelyCollectCommits:into:limit:" : "jr 3/2/2017 10:39", + "refsChangedExternally" : "mad 5/18/2024 11:48", "remoteHead:" : "mad 10/1/2023 16:52", "remoteNames" : "jr 7/22/2020 22:02", "remoteUrl:" : "jr 3/4/2020 00:46",