diff options
| author | 2026-03-08 03:43:52 +0800 | |
|---|---|---|
| committer | 2026-03-08 03:43:52 +0800 | |
| commit | e4659ebee6f2e51ba4c6bf653d66fd7947b031f7 (patch) | |
| tree | e18089760d253339b111c8e4f17b6aede0694057 /format/pack/ingest/thin_fix.go | |
| parent | receivepack: No receiving objects label (diff) | |
| signature | No signature | |
format/pack/ingest: Thin pack fixing progress v0.1.74
Diffstat (limited to 'format/pack/ingest/thin_fix.go')
| -rw-r--r-- | format/pack/ingest/thin_fix.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/format/pack/ingest/thin_fix.go b/format/pack/ingest/thin_fix.go index 42e356b6..35068079 100644 --- a/format/pack/ingest/thin_fix.go +++ b/format/pack/ingest/thin_fix.go @@ -55,6 +55,10 @@ func maybeFixThin(state *ingestState) error { baseIDs := unresolvedThinBaseIDs(state) total := len(baseIDs) + if total > 0 { + utils.WriteProgressf(state.opts.Progress, "fixing thin pack: 0%% (0/%d)\r", total) + } + for i, id := range baseIDs { ty, content, err := state.opts.Base.ReadBytesContent(id) if err != nil { @@ -68,7 +72,9 @@ func maybeFixThin(state *ingestState) error { state.thinFixed = true - utils.WriteProgressf(state.opts.Progress, "fixing thin pack: %d/%d\r", i+1, total) + done := i + 1 + percent := done * 100 / total + utils.WriteProgressf(state.opts.Progress, "fixing thin pack: %3d%% (%d/%d)\r", percent, done, total) } err = rewritePackHeaderAndTrailer(state) @@ -77,7 +83,7 @@ func maybeFixThin(state *ingestState) error { } if state.thinFixed { - utils.WriteProgressf(state.opts.Progress, "fixing thin pack: done.\n") + utils.WriteProgressf(state.opts.Progress, "fixing thin pack: 100%% (%d/%d), done.\n", total, total) } return nil |
