diff options
| author | 2026-04-02 06:23:30 +0000 | |
|---|---|---|
| committer | 2026-04-02 06:28:39 +0000 | |
| commit | a041d523de389b65b98a5373a8034041db2a8d83 (patch) | |
| tree | 7b423dc735f463be616045f2c3c2095a7737aca7 /repository/algorithm.go | |
| parent | research: Add dynamic pack resources (diff) | |
| signature | No signature | |
*: Remove
Diffstat (limited to 'repository/algorithm.go')
| -rw-r--r-- | repository/algorithm.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/repository/algorithm.go b/repository/algorithm.go deleted file mode 100644 index 1098f0b8..00000000 --- a/repository/algorithm.go +++ /dev/null @@ -1,29 +0,0 @@ -package repository - -import ( - "fmt" - - "codeberg.org/lindenii/furgit/config" - objectid "codeberg.org/lindenii/furgit/object/id" -) - -// detectObjectAlgorithm uses a repository's configuration to detect -// the expected Object ID hashing algorithm. -func detectObjectAlgorithm(cfg *config.Config) (objectid.Algorithm, error) { - algoName := cfg.Lookup("extensions", "", "objectformat").Value - if algoName == "" { - algoName = objectid.AlgorithmSHA1.String() - } - - algo, ok := objectid.ParseAlgorithm(algoName) - if !ok { - return objectid.AlgorithmUnknown, fmt.Errorf("repository: unsupported object format %q", algoName) - } - - return algo, nil -} - -// Algorithm returns the repository object ID algorithm. -func (repo *Repository) Algorithm() objectid.Algorithm { - return repo.algo -} |
