@@ -21,6 +21,7 @@ import (
2121	"fmt" 
2222	"io/ioutil" 
2323	"os" 
24+ 	"path/filepath" 
2425	"strings" 
2526	"time" 
2627
@@ -272,15 +273,16 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
272273	defer  unlock ()
273274
274275	// archive artifact and check integrity 
275- 	ps , err  :=  sourceignore .LoadIgnorePatterns (tmpGit , nil )
276+ 	ignoreDomain  :=  strings .Split (tmpGit , string (filepath .Separator ))
277+ 	ps , err  :=  sourceignore .LoadIgnorePatterns (tmpGit , ignoreDomain )
276278	if  err  !=  nil  {
277279		err  =  fmt .Errorf (".sourceignore error: %w" , err )
278280		return  sourcev1 .GitRepositoryNotReady (repository , sourcev1 .StorageOperationFailedReason , err .Error ()), err 
279281	}
280282	if  repository .Spec .Ignore  !=  nil  {
281- 		ps  =  append (ps , sourceignore .ReadPatterns (strings .NewReader (* repository .Spec .Ignore ), nil )... )
283+ 		ps  =  append (ps , sourceignore .ReadPatterns (strings .NewReader (* repository .Spec .Ignore ), ignoreDomain )... )
282284	}
283- 	if  err  :=  r .Storage .Archive (& artifact , tmpGit , SourceIgnoreFilter (ps , nil )); err  !=  nil  {
285+ 	if  err  :=  r .Storage .Archive (& artifact , tmpGit , SourceIgnoreFilter (ps , ignoreDomain )); err  !=  nil  {
284286		err  =  fmt .Errorf ("storage archive error: %w" , err )
285287		return  sourcev1 .GitRepositoryNotReady (repository , sourcev1 .StorageOperationFailedReason , err .Error ()), err 
286288	}
0 commit comments