diff options
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 -} |
