File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import (
3434 "github.com/bmatcuk/doublestar/v2"
3535 "github.com/go-git/go-billy/v5/osfs"
3636 "github.com/go-git/go-git/v5"
37+ "github.com/go-git/go-git/v5/plumbing"
3738 "github.com/go-git/go-git/v5/plumbing/format/gitignore"
3839 "github.com/go-git/go-git/v5/plumbing/object"
3940 "golang.org/x/sync/errgroup"
@@ -122,6 +123,11 @@ func listFiles(config *ConfigHeader) ([]string, error) {
122123 candidates = append (candidates , file .Name )
123124 return nil
124125 }); err != nil {
126+ if errors .Is (err , plumbing .ErrObjectNotFound ) {
127+ return nil , errors .New (
128+ "failed to read git repository. Run 'git fsck' to diagnose. If dangling objects are found, run: git prune && git gc --prune=now --aggressive" ,
129+ )
130+ }
125131 return nil , err
126132 }
127133 }
You can’t perform that action at this time.
0 commit comments