diff --git a/src/GToolkit4Git/AbstractFileReference.extension.st b/src/GToolkit4Git/AbstractFileReference.extension.st index aa8db00..513d8fb 100644 --- a/src/GToolkit4Git/AbstractFileReference.extension.st +++ b/src/GToolkit4Git/AbstractFileReference.extension.st @@ -5,6 +5,19 @@ AbstractFileReference >> filename [ ^self basename ] +{ #category : #'*GToolkit4Git' } +AbstractFileReference >> gtActionGitRepositoryFor: anAction [ + + + (self exists and: [ self isDirectory and: [ (self / '.git') exists ] ]) + ifFalse: [ ^ anAction noAction ]. + + ^ anAction button + icon: BrGlamorousVectorIcons branching; + tooltip: 'Open git repository'; + action: [ :element | element phlow spawnObject: (PureGitRepository on: self) ] +] + { #category : #'*GToolkit4Git' } AbstractFileReference >> name [ ^self basename