@@ -7,7 +7,6 @@ package git
77
88import (
99 "bufio"
10- "context"
1110 "io"
1211 "strings"
1312)
@@ -93,13 +92,13 @@ func (t *Tree) ListEntries() (Entries, error) {
9392
9493// listEntriesRecursive returns all entries of current tree recursively including all subtrees
9594// extraArgs could be "-l" to get the size, which is slower
96- func (t * Tree ) listEntriesRecursive (ctx context. Context , extraArgs TrustedCmdArgs ) (Entries , error ) {
95+ func (t * Tree ) listEntriesRecursive (extraArgs TrustedCmdArgs ) (Entries , error ) {
9796 if t .entriesRecursiveParsed {
9897 return t .entriesRecursive , nil
9998 }
10099
101100 t .entriesRecursive = make ([]* TreeEntry , 0 )
102- if err := t .IterateEntriesRecursive (ctx , func (entry * TreeEntry ) error {
101+ if err := t .IterateEntriesRecursive (func (entry * TreeEntry ) error {
103102 t .entriesRecursive = append (t .entriesRecursive , entry )
104103 return nil
105104 }, extraArgs ); err != nil {
@@ -112,18 +111,18 @@ func (t *Tree) listEntriesRecursive(ctx context.Context, extraArgs TrustedCmdArg
112111}
113112
114113// ListEntriesRecursiveFast returns all entries of current tree recursively including all subtrees, no size
115- func (t * Tree ) ListEntriesRecursiveFast (ctx context. Context ) (Entries , error ) {
116- return t .listEntriesRecursive (ctx , nil )
114+ func (t * Tree ) ListEntriesRecursiveFast () (Entries , error ) {
115+ return t .listEntriesRecursive (nil )
117116}
118117
119118// ListEntriesRecursiveWithSize returns all entries of current tree recursively including all subtrees, with size
120- func (t * Tree ) ListEntriesRecursiveWithSize (ctx context. Context ) (Entries , error ) {
121- return t .listEntriesRecursive (ctx , TrustedCmdArgs {"--long" })
119+ func (t * Tree ) ListEntriesRecursiveWithSize () (Entries , error ) {
120+ return t .listEntriesRecursive (TrustedCmdArgs {"--long" })
122121}
123122
124123// IterateEntriesRecursive returns iterate entries of current tree recursively including all subtrees
125124// extraArgs could be "-l" to get the size, which is slower
126- func (t * Tree ) IterateEntriesRecursive (ctx context. Context , f func (entry * TreeEntry ) error , extraArgs TrustedCmdArgs ) error {
125+ func (t * Tree ) IterateEntriesRecursive (f func (entry * TreeEntry ) error , extraArgs TrustedCmdArgs ) error {
127126 reader , writer := io .Pipe ()
128127 done := make (chan error )
129128
@@ -154,8 +153,8 @@ func (t *Tree) IterateEntriesRecursive(ctx context.Context, f func(entry *TreeEn
154153 }
155154
156155 select {
157- case <- ctx .Done ():
158- return ctx .Err ()
156+ case <- t . repo . Ctx .Done ():
157+ return t . repo . Ctx .Err ()
159158 case runErr := <- done :
160159 return runErr
161160 default :
0 commit comments