Skip to content

Commit

Permalink
Remove branch cache
Browse files Browse the repository at this point in the history
  • Loading branch information
refactoringdr committed May 20, 2024
1 parent 980d1dd commit d135d04
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 26 deletions.
4 changes: 1 addition & 3 deletions src/GToolkit4Git/GtGitRepository.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Class {
#instVars : [
'icebergRepository',
'announcer',
'isSubscribed',
'lepiterWorkingCopy',
'status',
'viewModel'
Expand Down Expand Up @@ -1065,8 +1064,7 @@ GtGitRepository >> incomingCommits [
{ #category : #initialization }
GtGitRepository >> initialize [
super initialize.
announcer := Announcer new.
isSubscribed := false.
announcer := Announcer new
]

{ #category : #'api - testing' }
Expand Down
1 change: 0 additions & 1 deletion src/GToolkit4Git/GtGitRepositoryViewModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ GtGitRepositoryViewModel >> onRepositoryModelChanged [

{ #category : #callbacks }
GtGitRepositoryViewModel >> onRepositoryModified: anAnnouncement [

(self hasRepository and: [
anAnnouncement repository = self repositoryModel repository ])
ifTrue: [
Expand Down
37 changes: 15 additions & 22 deletions src/GToolkit4Git/IceGitCliRepository.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Class {
'location',
'head',
'remoteMap',
'branchMap',
'revListMap',
'commitMap'
],
Expand Down Expand Up @@ -137,7 +136,6 @@ and the original repository''s url is {3}.'
{ #category : #accessing }
IceGitCliRepository >> clearCaches [
head := nil.
branchMap := Dictionary new
]

{ #category : #actions }
Expand Down Expand Up @@ -396,7 +394,6 @@ IceGitCliRepository >> initBare: isBareRepository [
IceGitCliRepository >> initialize [
super initialize.
remoteMap := Dictionary new.
branchMap := Dictionary new.
revListMap := Dictionary new.
commitMap := Dictionary new
]
Expand Down Expand Up @@ -461,15 +458,13 @@ IceGitCliRepository >> lookupLocalBranch: branchName [

{ #category : #'API - branches' }
IceGitCliRepository >> lookupLocalBranch: branchName ifAbsent: aBlock [
^ branchMap
at: branchName
ifAbsentPut: [ | lines |
lines := self runGitWithArgs: {
'branch'.
branchName.
'--list'.
'--format=%(objectname)' }.
lines isEmpty ifTrue: [ aBlock value ] ifFalse: [ lines first ] ]
| lines |
lines := self
runGitWithArgs: {'branch'.
branchName.
'--list'.
'--format=%(objectname)'}.
^lines isEmpty ifTrue: [ aBlock value ] ifFalse: [ lines first ]
]

{ #category : #'API - branches' }
Expand All @@ -479,16 +474,14 @@ IceGitCliRepository >> lookupRemoteBranch: branchName [

{ #category : #'API - branches' }
IceGitCliRepository >> lookupRemoteBranch: branchName ifAbsent: aBlock [
^ branchMap
at: branchName
ifAbsentPut: [ | lines |
lines := self runGitWithArgs: {
'branch'.
branchName.
'--remotes'.
'--list'.
'--format=%(objectname)' }.
lines isEmpty ifTrue: [ aBlock value ] ifFalse: [ lines first ] ]
| lines |
lines := self
runGitWithArgs: {'branch'.
branchName.
'--remotes'.
'--list'.
'--format=%(objectname)'}.
^ lines isEmpty ifTrue: [ aBlock value ] ifFalse: [ lines first ]
]

{ #category : #actions }
Expand Down

0 comments on commit d135d04

Please sign in to comment.