diff options
author | Taru Karttunen <taruti@taruti.net> | 2017-11-21 16:03:30 +0200 |
---|---|---|
committer | Jeremy Stribling <strib@alum.mit.edu> | 2017-11-29 11:01:41 -0800 |
commit | 9dcb096416b6ad16994763fcbc029bcfa95730e8 (patch) | |
tree | 1860a82f2e918409c3418df5ccc3664b98b7c925 /repository.go | |
parent | d96582a6fb7df092c2856f56decd33034fe0ade3 (diff) | |
download | go-git-9dcb096416b6ad16994763fcbc029bcfa95730e8.tar.gz |
Use Storer.Config pack window when repacking objects
Diffstat (limited to 'repository.go')
-rw-r--r-- | repository.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/repository.go b/repository.go index 999cc6d..1191b96 100644 --- a/repository.go +++ b/repository.go @@ -1018,8 +1018,6 @@ type RepackConfig struct { // UseRefDeltas configures whether packfile encoder will use reference deltas. // By default OFSDeltaObject is used. UseRefDeltas bool - // PackWindow for packing objects. - PackWindow uint // OnlyDeletePacksOlderThan if set to non-zero value // selects only objects older than the time provided. OnlyDeletePacksOlderThan time.Time @@ -1078,8 +1076,12 @@ func (r *Repository) createNewObjectPack(cfg *RepackConfig) (h plumbing.Hash, er if err != nil { return h, err } + scfg, err := r.Storer.Config() + if err != nil { + return h, err + } enc := packfile.NewEncoder(wc, r.Storer, cfg.UseRefDeltas) - h, err = enc.Encode(objs, cfg.PackWindow) + h, err = enc.Encode(objs, scfg.Pack.Window) if err != nil { return h, err } |