MCPcopy Create free account
hub / github.com/cloudflare/artifact-fs / schemeLessUserinfoHasPassword

Function schemeLessUserinfoHasPassword

internal/gitstore/gitstore.go:1033–1051  ·  view source on GitHub ↗
(raw string)

Source from the content-addressed store, hash-verified

1031 current = strings.TrimSpace(current)
1032 if current == oid {
1033 return current, nil
1034 }
1035 if _, err := runGit(ctx, repo.GitDir, "merge-base", "--is-ancestor", current, oid); err != nil {
1036 return "", fmt.Errorf("prepared git dir branch %s would be overwritten; refusing non-fast-forward update", branch)
1037 }
1038 return current, nil
1039}
1040
1041func zeroOIDForGitDir(ctx context.Context, gitDir string) (string, error) {
1042 format, err := runGit(ctx, gitDir, "rev-parse", "--show-object-format")
1043 if err != nil {
1044 return "", err
1045 }
1046 switch strings.TrimSpace(format) {
1047 case "sha1":
1048 return strings.Repeat("0", 40), nil
1049 case "sha256":
1050 return strings.Repeat("0", 64), nil
1051 default:
1052 return "", fmt.Errorf("unsupported Git object format %q", format)
1053 }
1054}

Callers 2

Calls 1

isSCPStyleRemoteFunction · 0.70

Tested by

no test coverage detected