Skip to content

Commit 2c334b0

Browse files
committed
git/githistory/rewriter.go: rename logger var
In the "githistory" package, the Rewriter and refUpdater structures both contain elements that are pointers to Logger structures from the "tasklog" package. Moreover, the refUpdater structure's element of this type is initialized from the value of the corresponding element of the Rewriter structure. However, these elements have different names, so we rename the Logger element of the Rewriter structure of "logger", which brings the two structure's element names into closer alignment, and also avoids the use of the abbreviated name "l", since the Logger element is used in multiple disparate methods and a more descriptive name is helpful in such cases.
1 parent 3225dc8 commit 2c334b0

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

git/githistory/rewriter.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ type Rewriter struct {
3232
// filter will cull out any unmodifiable subtrees and blobs.
3333
filter *filepathfilter.Filter
3434
// db is the *ObjectDatabase from which blobs, commits, and trees are
35-
// loaded from.
35+
// loaded.
3636
db *gitobj.ObjectDatabase
37-
// l is the *tasklog.Logger to which updates are written.
38-
l *tasklog.Logger
37+
// logger is the *tasklog.Logger to which updates are written.
38+
logger *tasklog.Logger
3939
}
4040

4141
// RewriteOptions is an options type given to the Rewrite() function.
@@ -161,7 +161,7 @@ var (
161161
// be given to the provided logger, "l".
162162
WithLogger = func(l *tasklog.Logger) rewriterOption {
163163
return func(r *Rewriter) {
164-
r.l = l
164+
r.logger = l
165165
}
166166
}
167167

@@ -204,9 +204,9 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) {
204204

205205
var perc *tasklog.PercentageTask
206206
if opt.UpdateRefs {
207-
perc = r.l.Percentage(tr.Tr.Get("Rewriting commits"), uint64(len(commits)))
207+
perc = r.logger.Percentage(tr.Tr.Get("Rewriting commits"), uint64(len(commits)))
208208
} else {
209-
perc = r.l.Percentage(tr.Tr.Get("Examining commits"), uint64(len(commits)))
209+
perc = r.logger.Percentage(tr.Tr.Get("Examining commits"), uint64(len(commits)))
210210
}
211211
defer perc.Complete()
212212

@@ -317,7 +317,7 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) {
317317

318318
updater := &refUpdater{
319319
cacheFn: r.uncacheCommit,
320-
logger: r.l,
320+
logger: r.logger,
321321
refs: refs,
322322
root: root,
323323
db: r.db,
@@ -500,7 +500,7 @@ func (r *Rewriter) rewriteBlob(commitOID, from []byte, path string, fn BlobRewri
500500
//
501501
// If any error was encountered, it will be returned.
502502
func (r *Rewriter) commitsToMigrate(opt *RewriteOptions) ([][]byte, error) {
503-
waiter := r.l.Waiter(tr.Tr.Get("Sorting commits"))
503+
waiter := r.logger.Waiter(tr.Tr.Get("Sorting commits"))
504504
defer waiter.Complete()
505505

506506
scanner, err := git.NewRevListScanner(

0 commit comments

Comments
 (0)