From e667c3c52a535ee67fe895bb0240fbad6e920087 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 7 Mar 2026 18:09:20 +0800 Subject: refstore/files: Accept timeout instead of reading from config And split things up again. --- repository/refs_timeout.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 repository/refs_timeout.go (limited to 'repository/refs_timeout.go') diff --git a/repository/refs_timeout.go b/repository/refs_timeout.go new file mode 100644 index 00000000..275613ba --- /dev/null +++ b/repository/refs_timeout.go @@ -0,0 +1,16 @@ +package repository + +import ( + "time" + + "codeberg.org/lindenii/furgit/config" +) + +func detectPackedRefsTimeout(cfg *config.Config) time.Duration { + timeoutValue, err := cfg.Lookup("core", "", "packedrefstimeout").Int() + if err != nil { + return time.Second + } + + return time.Duration(timeoutValue) * time.Millisecond +} -- cgit v1.3.1-10-gc9f91