diff --git a/commands/command_checkout.go b/commands/command_checkout.go index e8dab305..6c313e43 100644 --- a/commands/command_checkout.go +++ b/commands/command_checkout.go @@ -6,9 +6,9 @@ import ( "github.com/git-lfs/git-lfs/filepathfilter" "github.com/git-lfs/git-lfs/git" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/lfs" "github.com/git-lfs/git-lfs/progress" + "github.com/git-lfs/git-lfs/tasklog" "github.com/spf13/cobra" ) @@ -27,7 +27,7 @@ func checkoutCommand(cmd *cobra.Command, args []string) { var totalBytes int64 var pointers []*lfs.WrappedPointer - logger := log.NewLogger(os.Stdout) + logger := tasklog.NewLogger(os.Stdout) meter := progress.NewMeter(progress.WithOSEnv(cfg.Os)) logger.Enqueue(meter) chgitscanner := lfs.NewGitScanner(func(p *lfs.WrappedPointer, err error) { diff --git a/commands/command_fetch.go b/commands/command_fetch.go index 65bb919e..0cdd5e3b 100644 --- a/commands/command_fetch.go +++ b/commands/command_fetch.go @@ -7,9 +7,9 @@ import ( "github.com/git-lfs/git-lfs/filepathfilter" "github.com/git-lfs/git-lfs/git" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/lfs" "github.com/git-lfs/git-lfs/progress" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tq" "github.com/rubyist/tracerx" "github.com/spf13/cobra" @@ -229,7 +229,7 @@ func fetchAll() bool { func scanAll() []*lfs.WrappedPointer { // This could be a long process so use the chan version & report progress Print("Scanning for all objects ever referenced...") - logger := log.NewLogger(OutputWriter) + logger := tasklog.NewLogger(OutputWriter) spinner := progress.NewSpinner() logger.Enqueue(spinner) var numObjs int64 @@ -325,7 +325,7 @@ func fetchAndReportToChan(allpointers []*lfs.WrappedPointer, filter *filepathfil } func readyAndMissingPointers(allpointers []*lfs.WrappedPointer, filter *filepathfilter.Filter) ([]*lfs.WrappedPointer, []*lfs.WrappedPointer, *progress.ProgressMeter) { - logger := log.NewLogger(os.Stdout) + logger := tasklog.NewLogger(os.Stdout) meter := buildProgressMeter(false) logger.Enqueue(meter) diff --git a/commands/command_migrate.go b/commands/command_migrate.go index 29fe8542..cf35b5b4 100644 --- a/commands/command_migrate.go +++ b/commands/command_migrate.go @@ -8,8 +8,8 @@ import ( "github.com/git-lfs/git-lfs/errors" "github.com/git-lfs/git-lfs/git" "github.com/git-lfs/git-lfs/git/githistory" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/git/odb" + "github.com/git-lfs/git-lfs/tasklog" "github.com/spf13/cobra" ) @@ -36,7 +36,7 @@ var ( // migrate takes the given command and arguments, *odb.ObjectDatabase, as well // as a BlobRewriteFn to apply, and performs a migration. -func migrate(args []string, r *githistory.Rewriter, l *log.Logger, opts *githistory.RewriteOptions) { +func migrate(args []string, r *githistory.Rewriter, l *tasklog.Logger, opts *githistory.RewriteOptions) { requireInRepo() opts, err := rewriteOptions(args, opts, l) @@ -73,7 +73,7 @@ func getObjectDatabase() (*odb.ObjectDatabase, error) { // // If any of the above could not be determined without error, that error will be // returned immediately. -func rewriteOptions(args []string, opts *githistory.RewriteOptions, l *log.Logger) (*githistory.RewriteOptions, error) { +func rewriteOptions(args []string, opts *githistory.RewriteOptions, l *tasklog.Logger) (*githistory.RewriteOptions, error) { include, exclude, err := includeExcludeRefs(l, args) if err != nil { return nil, err @@ -102,7 +102,7 @@ func rewriteOptions(args []string, opts *githistory.RewriteOptions, l *log.Logge // arguments and the --include-ref= or --exclude-ref= flag(s) aren't given. // - Include all references given in --include-ref=. // - Exclude all references given in --exclude-ref=. -func includeExcludeRefs(l *log.Logger, args []string) (include, exclude []string, err error) { +func includeExcludeRefs(l *tasklog.Logger, args []string) (include, exclude []string, err error) { hardcore := len(migrateIncludeRefs) > 0 || len(migrateExcludeRefs) > 0 if len(args) == 0 && !hardcore && !migrateEverything { @@ -171,7 +171,7 @@ func includeExcludeRefs(l *log.Logger, args []string) (include, exclude []string // getRemoteRefs returns a fully qualified set of references belonging to all // remotes known by the currently checked-out repository, or an error if those // references could not be determined. -func getRemoteRefs(l *log.Logger) ([]*git.Ref, error) { +func getRemoteRefs(l *tasklog.Logger) ([]*git.Ref, error) { var refs []*git.Ref remotes, err := git.RemoteList() @@ -248,7 +248,7 @@ func currentRefToMigrate() (*git.Ref, error) { // getHistoryRewriter returns a history rewriter that includes the filepath // filter given by the --include and --exclude arguments. -func getHistoryRewriter(cmd *cobra.Command, db *odb.ObjectDatabase, l *log.Logger) *githistory.Rewriter { +func getHistoryRewriter(cmd *cobra.Command, db *odb.ObjectDatabase, l *tasklog.Logger) *githistory.Rewriter { include, exclude := getIncludeExcludeArgs(cmd) filter := buildFilepathFilter(cfg, include, exclude) diff --git a/commands/command_migrate_import.go b/commands/command_migrate_import.go index 16ba135a..5f1f9c8a 100644 --- a/commands/command_migrate_import.go +++ b/commands/command_migrate_import.go @@ -12,15 +12,15 @@ import ( "github.com/git-lfs/git-lfs/filepathfilter" "github.com/git-lfs/git-lfs/git" "github.com/git-lfs/git-lfs/git/githistory" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/git/odb" "github.com/git-lfs/git-lfs/lfs" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tools" "github.com/spf13/cobra" ) func migrateImportCommand(cmd *cobra.Command, args []string) { - l := log.NewLogger(os.Stderr) + l := tasklog.NewLogger(os.Stderr) defer l.Close() db, err := getObjectDatabase() diff --git a/commands/command_migrate_info.go b/commands/command_migrate_info.go index 9b08304b..2c1fa924 100644 --- a/commands/command_migrate_info.go +++ b/commands/command_migrate_info.go @@ -10,8 +10,8 @@ import ( "github.com/git-lfs/git-lfs/errors" "github.com/git-lfs/git-lfs/git/githistory" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/git/odb" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tools" "github.com/git-lfs/git-lfs/tools/humanize" "github.com/spf13/cobra" @@ -40,7 +40,7 @@ var ( ) func migrateInfoCommand(cmd *cobra.Command, args []string) { - l := log.NewLogger(os.Stderr) + l := tasklog.NewLogger(os.Stderr) db, err := getObjectDatabase() if err != nil { diff --git a/commands/command_prune.go b/commands/command_prune.go index c0f2c97e..27570867 100644 --- a/commands/command_prune.go +++ b/commands/command_prune.go @@ -9,9 +9,9 @@ import ( "github.com/git-lfs/git-lfs/fs" "github.com/git-lfs/git-lfs/git" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/lfs" "github.com/git-lfs/git-lfs/progress" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tools" "github.com/git-lfs/git-lfs/tools/humanize" "github.com/git-lfs/git-lfs/tq" @@ -57,7 +57,7 @@ func prune(fetchPruneConfig lfs.FetchPruneConfig, verifyRemote, dryRun, verbose localObjects := make([]fs.Object, 0, 100) retainedObjects := tools.NewStringSetWithCapacity(100) - logger := log.NewLogger(OutputWriter) + logger := tasklog.NewLogger(OutputWriter) spinner := progress.NewSpinner() logger.Enqueue(spinner) diff --git a/commands/command_pull.go b/commands/command_pull.go index 4ada3ece..10466a3d 100644 --- a/commands/command_pull.go +++ b/commands/command_pull.go @@ -8,9 +8,9 @@ import ( "github.com/git-lfs/git-lfs/filepathfilter" "github.com/git-lfs/git-lfs/git" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/lfs" "github.com/git-lfs/git-lfs/progress" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tq" "github.com/rubyist/tracerx" "github.com/spf13/cobra" @@ -39,7 +39,7 @@ func pull(filter *filepathfilter.Filter) { } pointers := newPointerMap() - logger := log.NewLogger(os.Stdout) + logger := tasklog.NewLogger(os.Stdout) meter := progress.NewMeter(progress.WithOSEnv(cfg.Os)) logger.Enqueue(meter) remote := cfg.Remote() diff --git a/commands/uploader.go b/commands/uploader.go index efcb088a..c8cf5b27 100644 --- a/commands/uploader.go +++ b/commands/uploader.go @@ -11,9 +11,9 @@ import ( "sync" "github.com/git-lfs/git-lfs/errors" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/lfs" "github.com/git-lfs/git-lfs/progress" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tools" "github.com/git-lfs/git-lfs/tq" "github.com/rubyist/tracerx" @@ -57,7 +57,7 @@ type uploadContext struct { uploadedOids tools.StringSet gitfilter *lfs.GitFilter - logger *log.Logger + logger *tasklog.Logger meter progress.Meter tq *tq.TransferQueue @@ -93,7 +93,7 @@ func newUploadContext(dryRun bool) *uploadContext { sink = ioutil.Discard } - ctx.logger = log.NewLogger(sink) + ctx.logger = tasklog.NewLogger(sink) ctx.meter = buildProgressMeter(ctx.DryRun) ctx.logger.Enqueue(ctx.meter) diff --git a/git/githistory/ref_updater.go b/git/githistory/ref_updater.go index a9d0b5b9..f0752dbd 100644 --- a/git/githistory/ref_updater.go +++ b/git/githistory/ref_updater.go @@ -7,7 +7,7 @@ import ( "github.com/git-lfs/git-lfs/errors" "github.com/git-lfs/git-lfs/git" - "github.com/git-lfs/git-lfs/git/githistory/log" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tools" ) @@ -19,7 +19,7 @@ type refUpdater struct { // signaling whether or not that given "old" SHA1 was migrated. CacheFn func(old []byte) ([]byte, bool) // Logger logs the progress of reference updating. - Logger *log.Logger + Logger *tasklog.Logger // Refs is a set of *git.Ref's to migrate. Refs []*git.Ref // Root is the given directory on disk in which the repository is diff --git a/git/githistory/rewriter.go b/git/githistory/rewriter.go index 73df71e1..d2a2d309 100644 --- a/git/githistory/rewriter.go +++ b/git/githistory/rewriter.go @@ -11,8 +11,8 @@ import ( "github.com/git-lfs/git-lfs/errors" "github.com/git-lfs/git-lfs/filepathfilter" "github.com/git-lfs/git-lfs/git" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/git/odb" + "github.com/git-lfs/git-lfs/tasklog" ) // Rewriter allows rewriting topologically equivalent Git histories @@ -34,8 +34,8 @@ type Rewriter struct { // db is the *ObjectDatabase from which blobs, commits, and trees are // loaded from. db *odb.ObjectDatabase - // l is the *log.Logger to which updates are written. - l *log.Logger + // l is the *tasklog.Logger to which updates are written. + l *tasklog.Logger } // RewriteOptions is an options type given to the Rewrite() function. @@ -133,12 +133,12 @@ var ( // WithLoggerto logs updates caused by the *git/githistory.Rewriter to // the given io.Writer "sink". WithLoggerTo = func(sink io.Writer) rewriterOption { - return WithLogger(log.NewLogger(sink)) + return WithLogger(tasklog.NewLogger(sink)) } // WithLogger logs updates caused by the *git/githistory.Rewriter to the // be given to the provided logger, "l". - WithLogger = func(l *log.Logger) rewriterOption { + WithLogger = func(l *tasklog.Logger) rewriterOption { return func(r *Rewriter) { r.l = l } @@ -177,14 +177,14 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) { return nil, err } - var perc *log.PercentageTask + var perc *tasklog.PercentageTask if opt.UpdateRefs { perc = r.l.Percentage("migrate: Rewriting commits", uint64(len(commits))) } else { perc = r.l.Percentage("migrate: Examining commits", uint64(len(commits))) } - var vPerc *log.PercentageTask + var vPerc *tasklog.PercentageTask if opt.Verbose { vPerc = perc } @@ -301,7 +301,7 @@ func (r *Rewriter) Rewrite(opt *RewriteOptions) ([]byte, error) { // // It returns the new SHA of the rewritten tree, or an error if the tree was // unable to be rewritten. -func (r *Rewriter) rewriteTree(commitOID []byte, treeOID []byte, path string, fn BlobRewriteFn, tfn TreeCallbackFn, perc *log.PercentageTask) ([]byte, error) { +func (r *Rewriter) rewriteTree(commitOID []byte, treeOID []byte, path string, fn BlobRewriteFn, tfn TreeCallbackFn, perc *tasklog.PercentageTask) ([]byte, error) { tree, err := r.db.Tree(treeOID) if err != nil { return nil, err @@ -371,7 +371,7 @@ func (r *Rewriter) allows(typ odb.ObjectType, abs string) bool { // database by the SHA1 "from" []byte. It writes and returns the new blob SHA, // or an error if either the BlobRewriteFn returned one, or if the object could // not be loaded/saved. -func (r *Rewriter) rewriteBlob(commitOID, from []byte, path string, fn BlobRewriteFn, perc *log.PercentageTask) ([]byte, error) { +func (r *Rewriter) rewriteBlob(commitOID, from []byte, path string, fn BlobRewriteFn, perc *tasklog.PercentageTask) ([]byte, error) { blob, err := r.db.Blob(from) if err != nil { return nil, err diff --git a/progress/meter.go b/progress/meter.go index 35de01b0..cacd40d5 100644 --- a/progress/meter.go +++ b/progress/meter.go @@ -8,7 +8,7 @@ import ( "sync/atomic" "time" - "github.com/git-lfs/git-lfs/git/githistory/log" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/tools/humanize" ) @@ -29,7 +29,7 @@ type ProgressMeter struct { fileIndex map[string]int64 // Maps a file name to its transfer number fileIndexMutex *sync.Mutex dryRun bool - updates chan *log.Update + updates chan *tasklog.Update } type env interface { @@ -92,7 +92,7 @@ func NewMeter(options ...meterOption) *ProgressMeter { logger: &progressLogger{}, fileIndex: make(map[string]int64), fileIndexMutex: &sync.Mutex{}, - updates: make(chan *log.Update), + updates: make(chan *tasklog.Update), } for _, opt := range options { @@ -164,7 +164,7 @@ func (p *ProgressMeter) Finish() { close(p.updates) } -func (p *ProgressMeter) Updates() <-chan *log.Update { +func (p *ProgressMeter) Updates() <-chan *tasklog.Update { return p.updates } @@ -177,7 +177,7 @@ func (p *ProgressMeter) update() { return } - p.updates <- &log.Update{ + p.updates <- &tasklog.Update{ S: p.str(), At: time.Now(), } diff --git a/progress/noop.go b/progress/noop.go index 6402da2e..1b5a8f0b 100644 --- a/progress/noop.go +++ b/progress/noop.go @@ -1,15 +1,15 @@ package progress -import "github.com/git-lfs/git-lfs/git/githistory/log" +import "github.com/git-lfs/git-lfs/tasklog" func Noop() Meter { return &nonMeter{ - updates: make(chan *log.Update), + updates: make(chan *tasklog.Update), } } type nonMeter struct { - updates chan *log.Update + updates chan *tasklog.Update } func (m *nonMeter) Start() {} @@ -23,5 +23,5 @@ func (m *nonMeter) Finish() { close(m.updates) } -func (m *nonMeter) Updates() <-chan *log.Update { return m.updates } -func (m *nonMeter) Throttled() bool { return false } +func (m *nonMeter) Updates() <-chan *tasklog.Update { return m.updates } +func (m *nonMeter) Throttled() bool { return false } diff --git a/progress/progress.go b/progress/progress.go index 496e90cb..cf23c240 100644 --- a/progress/progress.go +++ b/progress/progress.go @@ -2,10 +2,10 @@ // NOTE: Subject to change, do not rely on this package from outside git-lfs source package progress -import "github.com/git-lfs/git-lfs/git/githistory/log" +import "github.com/git-lfs/git-lfs/tasklog" type Meter interface { - log.Task + tasklog.Task Start() Pause() diff --git a/progress/spinner.go b/progress/spinner.go index 060b71c6..517e2a42 100644 --- a/progress/spinner.go +++ b/progress/spinner.go @@ -5,7 +5,7 @@ import ( "runtime" "time" - "github.com/git-lfs/git-lfs/git/githistory/log" + "github.com/git-lfs/git-lfs/tasklog" ) // Indeterminate progress indicator 'spinner' @@ -13,18 +13,18 @@ type Spinner struct { stage int msg string - updates chan *log.Update + updates chan *tasklog.Update } var spinnerChars = []byte{'|', '/', '-', '\\'} func NewSpinner() *Spinner { return &Spinner{ - updates: make(chan *log.Update), + updates: make(chan *tasklog.Update), } } -func (s *Spinner) Updates() <-chan *log.Update { +func (s *Spinner) Updates() <-chan *tasklog.Update { return s.updates } @@ -62,7 +62,7 @@ func (s *Spinner) spin(msg string) { } func (s *Spinner) update(sym, msg string) { - s.updates <- &log.Update{ + s.updates <- &tasklog.Update{ S: fmt.Sprintf("%s %s", sym, msg), At: time.Now(), } diff --git a/git/githistory/log/list_task.go b/tasklog/list_task.go similarity index 98% rename from git/githistory/log/list_task.go rename to tasklog/list_task.go index d426df70..ae367a7a 100644 --- a/git/githistory/log/list_task.go +++ b/tasklog/list_task.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "fmt" diff --git a/git/githistory/log/list_task_test.go b/tasklog/list_task_test.go similarity index 65% rename from git/githistory/log/list_task_test.go rename to tasklog/list_task_test.go index f0331ea1..0ae41c5d 100644 --- a/git/githistory/log/list_task_test.go +++ b/tasklog/list_task_test.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "testing" @@ -14,9 +14,9 @@ func TestListTaskCallsDoneWhenComplete(t *testing.T) { case update, ok := <-task.Updates(): assert.Equal(t, "example: ...", update.S) assert.True(t, ok, - "git/githistory/log: expected Updates() to remain open") + "tasklog: expected Updates() to remain open") default: - t.Fatal("git/githistory/log: expected update from *ListTask") + t.Fatal("tasklog: expected update from *ListTask") } select { @@ -24,7 +24,7 @@ func TestListTaskCallsDoneWhenComplete(t *testing.T) { assert.False(t, ok, "git/githistory.log: unexpected *ListTask.Update(): %s", update) default: - t.Fatal("git/githistory/log: expected *ListTask.Updates() to be closed") + t.Fatal("tasklog: expected *ListTask.Updates() to be closed") } } @@ -35,10 +35,10 @@ func TestListTaskWritesEntries(t *testing.T) { select { case update, ok := <-task.Updates(): assert.True(t, ok, - "git/githistory/log: expected ListTask.Updates() to remain open") + "tasklog: expected ListTask.Updates() to remain open") assert.Equal(t, "1\n", update.S) default: - t.Fatal("git/githistory/log: expected task.Updates() to have an update") + t.Fatal("tasklog: expected task.Updates() to have an update") } } @@ -48,5 +48,5 @@ func TestListTaskIsNotThrottled(t *testing.T) { throttled := task.Throttled() assert.False(t, throttled, - "git/githistory/log: expected *ListTask to be Throttle()-d") + "tasklog: expected *ListTask to be Throttle()-d") } diff --git a/git/githistory/log/log.go b/tasklog/log.go similarity index 97% rename from git/githistory/log/log.go rename to tasklog/log.go index 0244f547..05fb0bc2 100644 --- a/git/githistory/log/log.go +++ b/tasklog/log.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "fmt" @@ -187,8 +187,8 @@ func (l *Logger) consume() { // of time specified by `l.throttle time.Duration`. // // If the duration if 0, or the task is "durable" (by implementing -// github.com/git-lfs/git-lfs/git/githistory/log#DurableTask), then all entries -// will be logged. +// github.com/git-lfs/git-lfs/tasklog#DurableTask), then all entries will be +// logged. func (l *Logger) logTask(task Task) { defer l.wg.Done() diff --git a/git/githistory/log/log_test.go b/tasklog/log_test.go similarity index 99% rename from git/githistory/log/log_test.go rename to tasklog/log_test.go index bf585c89..7d0ac3c7 100644 --- a/git/githistory/log/log_test.go +++ b/tasklog/log_test.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "bytes" diff --git a/git/githistory/log/percentage_task.go b/tasklog/percentage_task.go similarity index 97% rename from git/githistory/log/percentage_task.go rename to tasklog/percentage_task.go index 2f673da0..078597e3 100644 --- a/git/githistory/log/percentage_task.go +++ b/tasklog/percentage_task.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "fmt" @@ -41,7 +41,7 @@ func NewPercentageTask(msg string, total uint64) *PercentageTask { // been completed. func (c *PercentageTask) Count(n uint64) (new uint64) { if new = atomic.AddUint64(&c.n, n); new > c.total { - panic("git/githistory/log: counted too many items") + panic("tasklog: counted too many items") } var percentage float64 diff --git a/git/githistory/log/percentage_task_test.go b/tasklog/percentage_task_test.go similarity index 89% rename from git/githistory/log/percentage_task_test.go rename to tasklog/percentage_task_test.go index fd7bc357..3159cd57 100644 --- a/git/githistory/log/percentage_task_test.go +++ b/tasklog/percentage_task_test.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "testing" @@ -58,13 +58,13 @@ func TestPercentageTaskIsThrottled(t *testing.T) { throttled := task.Throttled() assert.True(t, throttled, - "git/githistory/log: expected *PercentageTask to be Throttle()-d") + "tasklog: expected *PercentageTask to be Throttle()-d") } func TestPercentageTaskPanicsWhenOvercounted(t *testing.T) { task := NewPercentageTask("example", 0) defer func() { - assert.Equal(t, "git/githistory/log: counted too many items", recover()) + assert.Equal(t, "tasklog: counted too many items", recover()) }() task.Count(1) diff --git a/git/githistory/log/task.go b/tasklog/task.go similarity index 98% rename from git/githistory/log/task.go rename to tasklog/task.go index 22d78ed4..4faa77dd 100644 --- a/git/githistory/log/task.go +++ b/tasklog/task.go @@ -1,4 +1,4 @@ -package log +package tasklog import "time" diff --git a/git/githistory/log/waiting_task.go b/tasklog/waiting_task.go similarity index 98% rename from git/githistory/log/waiting_task.go rename to tasklog/waiting_task.go index 356da0f9..bfae2d67 100644 --- a/git/githistory/log/waiting_task.go +++ b/tasklog/waiting_task.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "fmt" diff --git a/git/githistory/log/waiting_task_test.go b/tasklog/waiting_task_test.go similarity index 84% rename from git/githistory/log/waiting_task_test.go rename to tasklog/waiting_task_test.go index c9e81aed..ccd62c35 100644 --- a/git/githistory/log/waiting_task_test.go +++ b/tasklog/waiting_task_test.go @@ -1,4 +1,4 @@ -package log +package tasklog import ( "testing" @@ -39,12 +39,12 @@ func TestWaitingTaskPanicsWithMultipleDoneCalls(t *testing.T) { defer func() { if err := recover(); err == nil { - t.Fatal("githistory/log: expected panic()") + t.Fatal("tasklog: expected panic()") } else { if s, ok := err.(error); ok { assert.Equal(t, "close of closed channel", s.Error()) } else { - t.Fatal("githistory/log: expected panic() to implement error") + t.Fatal("tasklog: expected panic() to implement error") } } }() @@ -58,5 +58,5 @@ func TestWaitingTaskIsThrottled(t *testing.T) { throttled := task.Throttled() assert.True(t, throttled, - "git/githistory/log: expected *WaitingTask to be Throttle()-d") + "tasklog: expected *WaitingTask to be Throttle()-d") } diff --git a/test/git-lfs-test-server-api/main.go b/test/git-lfs-test-server-api/main.go index 56ab625f..026fba2f 100644 --- a/test/git-lfs-test-server-api/main.go +++ b/test/git-lfs-test-server-api/main.go @@ -12,9 +12,9 @@ import ( "github.com/git-lfs/git-lfs/errors" "github.com/git-lfs/git-lfs/fs" - "github.com/git-lfs/git-lfs/git/githistory/log" "github.com/git-lfs/git-lfs/lfsapi" "github.com/git-lfs/git-lfs/progress" + "github.com/git-lfs/git-lfs/tasklog" "github.com/git-lfs/git-lfs/test" "github.com/git-lfs/git-lfs/tq" "github.com/spf13/cobra" @@ -180,7 +180,7 @@ func buildTestData(repo *test.Repo, manifest *tq.Manifest) (oidsExist, oidsMissi oidsMissing = make([]TestObject, 0, oidCount) // just one commit - logger := log.NewLogger(os.Stdout) + logger := tasklog.NewLogger(os.Stdout) meter := progress.NewMeter(progress.WithOSEnv(repo.OSEnv())) logger.Enqueue(meter) commit := test.CommitInput{CommitterName: "A N Other", CommitterEmail: "noone@somewhere.com"}