mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-23 14:53:34 +01:00
a21128a734
See https://codeberg.org/forgejo/discussions/issues/164 for the rationale and discussion of this change. Everything related to the `go-git` dependency is dropped (Only a single instance is left in a test file to test for an XSS, it requires crafting an commit that Git itself refuses to craft). `_gogit` files have been removed entirely, `go:build: !gogit` is removed, `XXX_nogogit.go` files either have been renamed or had their code being merged into the `XXX.go` file.
26 lines
595 B
Go
26 lines
595 B
Go
// Copyright 2024 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package git
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// This file contains utility functions that are used across multiple tests,
|
|
// but not in production code.
|
|
|
|
func skipIfSHA256NotSupported(t *testing.T) {
|
|
if CheckGitVersionAtLeast("2.42") != nil {
|
|
t.Skip("skipping because installed Git version doesn't support SHA256")
|
|
}
|
|
}
|
|
|
|
func TestHashFilePathForWebUI(t *testing.T) {
|
|
assert.Equal(t,
|
|
"8843d7f92416211de9ebb963ff4ce28125932878",
|
|
HashFilePathForWebUI("foobar"),
|
|
)
|
|
}
|