aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/git/repo.go')
-rw-r--r--modules/git/repo.go27
1 files changed, 0 insertions, 27 deletions
diff --git a/modules/git/repo.go b/modules/git/repo.go
index d4e1669bec..1c223018ad 100644
--- a/modules/git/repo.go
+++ b/modules/git/repo.go
@@ -7,7 +7,6 @@ package git
import (
"bytes"
"context"
- "errors"
"fmt"
"io"
"net/url"
@@ -63,32 +62,6 @@ func IsRepoURLAccessible(ctx context.Context, url string) bool {
return err == nil
}
-// GetObjectFormatOfRepo returns the hash type of repository at a given path
-func GetObjectFormatOfRepo(ctx context.Context, repoPath string) (ObjectFormat, error) {
- var stdout, stderr strings.Builder
-
- err := NewCommand(ctx, "hash-object", "--stdin").Run(&RunOpts{
- Dir: repoPath,
- Stdout: &stdout,
- Stderr: &stderr,
- Stdin: &strings.Reader{},
- })
- if err != nil {
- return nil, err
- }
-
- if stderr.Len() > 0 {
- return nil, errors.New(stderr.String())
- }
-
- h, err := NewIDFromString(strings.TrimRight(stdout.String(), "\n"))
- if err != nil {
- return nil, err
- }
-
- return h.Type(), nil
-}
-
// InitRepository initializes a new Git repository.
func InitRepository(ctx context.Context, repoPath string, bare bool, objectFormatName string) error {
err := os.MkdirAll(repoPath, os.ModePerm)