@@ -21,6 +21,7 @@ import (
21
21
"fmt"
22
22
"io/ioutil"
23
23
"os"
24
+ "path/filepath"
24
25
"strings"
25
26
"time"
26
27
@@ -272,15 +273,16 @@ func (r *GitRepositoryReconciler) reconcile(ctx context.Context, repository sour
272
273
defer unlock ()
273
274
274
275
// 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 )
276
278
if err != nil {
277
279
err = fmt .Errorf (".sourceignore error: %w" , err )
278
280
return sourcev1 .GitRepositoryNotReady (repository , sourcev1 .StorageOperationFailedReason , err .Error ()), err
279
281
}
280
282
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 )... )
282
284
}
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 {
284
286
err = fmt .Errorf ("storage archive error: %w" , err )
285
287
return sourcev1 .GitRepositoryNotReady (repository , sourcev1 .StorageOperationFailedReason , err .Error ()), err
286
288
}
0 commit comments