- More API methods...
"{ Package: 'stx:libscm/git' }"
GitHandle subclass:#GitRepository
instanceVariableNames:''
classVariableNames:''
poolDictionaries:'GitObjectType'
category:'Git-Model'
!
!GitRepository class methodsFor:'instance creation'!
open: aString
| ref err |
ref := ByteArray new: ExternalBytes sizeofPointer.
err := GitPrimitives prim_git_repository_open: ref path: aString.
err ~~ 0 ifTrue:[
self error:'gitlib2 error'
].
^self new setAddressFromBytes:ref
"Created: / 07-09-2012 / 23:45:19 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GitRepository class methodsFor:'accessing'!
structSize
"Returns size of undelaying structure in bytes"
^0
! !
!GitRepository methodsFor:'finalization'!
basicFree
GitPrimitives prim_git_object_free: self.
"Created: / 08-09-2012 / 00:20:34 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GitRepository methodsFor:'lookup'!
lookup: oid
"Lookup an object with given OID"
^self lookup: oid type: OBJ_ANY
"Created: / 10-09-2012 / 10:53:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
lookup: oid type: typeId
"Lookup an object with given OID"
| ref err type obj |
oid class == GitOid ifFalse:[
self error: 'Passed oid is not a GitOid'.
^nil.
].
ref := ByteArray new: ExternalBytes sizeofPointer.
err := GitPrimitives prim_git_object_lookup: ref repo: self id: oid type: typeId.
err ~~ 0 ifTrue:[
self error:'gitlib2 error'
].
typeId == OBJ_ANY ifTrue:[
obj := ExternalAddress new setAddressFromBytes:ref.
type := GitPrimitives prim_git_object_type: obj.
].
^GitObject type: type addressBytes: ref.
"Created: / 10-09-2012 / 11:01:25 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !
!GitRepository class methodsFor:'documentation'!
version_SVN
^ '$Id:: $'
! !