@@ -283,11 +283,14 @@ func (d *DotGit) objectPath(h plumbing.Hash) string {
283283 return d .fs .Join (objectsPath , hash [0 :2 ], hash [2 :40 ])
284284}
285285
286- //incomingObjectPath is intended to add support for a git pre-recieve hook to be written
287- //it adds support for go-git to find objects in an "incoming" directory, so that the library
288- //can be used to write a pre-recieve hook that deals with the incoming objects.
289- //More on git hooks found here : https://git-scm.com/docs/githooks
290- //More on 'quarantine'/incoming directory here : https://git-scm.com/docs/git-receive-pack
286+ // incomingObjectPath is intended to add support for a git pre-receive hook
287+ // to be written it adds support for go-git to find objects in an "incoming"
288+ // directory, so that the library can be used to write a pre-receive hook
289+ // that deals with the incoming objects.
290+ //
291+ // More on git hooks found here : https://git-scm.com/docs/githooks
292+ // More on 'quarantine'/incoming directory here:
293+ // https://git-scm.com/docs/git-receive-pack
291294func (d * DotGit ) incomingObjectPath (h plumbing.Hash ) string {
292295 hString := h .String ()
293296
@@ -305,7 +308,7 @@ func (d *DotGit) hasIncomingObjects() bool {
305308 directoryContents , err := d .fs .ReadDir (objectsPath )
306309 if err == nil {
307310 for _ , file := range directoryContents {
308- if strings .Split (file .Name (), "-" )[ 0 ] == "incoming" && file .IsDir () {
311+ if strings .HasPrefix (file .Name (), "incoming -" ) && file .IsDir () {
309312 d .incomingDirName = file .Name ()
310313 }
311314 }
0 commit comments