MCPcopy
hub / github.com/git-lfs/git-lfs / IsBare

Function IsBare

git/git.go:1117–1126  ·  view source on GitHub ↗

IsBare returns whether or not a repository is bare. It requires that the current working directory is a repository. If there was an error determining whether or not the repository is bare, it will be returned.

()

Source from the content-addressed store, hash-verified

1115// If there was an error determining whether or not the repository is bare, it
1116// will be returned.
1117func IsBare() (bool, error) {
1118 s, err := subprocess.SimpleExec(
1119 "git", "rev-parse", "--is-bare-repository")
1120
1121 if err != nil {
1122 return false, err
1123 }
1124
1125 return strconv.ParseBool(s)
1126}
1127
1128// For compatibility with git clone we must mirror all flags in CloneWithoutFilters
1129type CloneFlags struct {

Callers 6

includeExcludeRefsFunction · 0.92
setupRepositoryFunction · 0.92
checkoutNonBareFunction · 0.92
migrateExportCommandFunction · 0.92
IsWorkingCopyDirtyFunction · 0.85
SourcesMethod · 0.85

Calls 1

SimpleExecFunction · 0.92

Tested by

no test coverage detected