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

Function IsWorkingCopyDirty

git/git.go:1655–1666  ·  view source on GitHub ↗

IsWorkingCopyDirty returns true if and only if the working copy in which the command was executed is dirty as compared to the index. If the status of the working copy could not be determined, an error will be returned instead.

()

Source from the content-addressed store, hash-verified

1653// If the status of the working copy could not be determined, an error will be
1654// returned instead.
1655func IsWorkingCopyDirty() (bool, error) {
1656 bare, err := IsBare()
1657 if bare || err != nil {
1658 return false, err
1659 }
1660
1661 out, err := gitSimple("status", "--porcelain")
1662 if err != nil {
1663 return false, err
1664 }
1665 return len(out) != 0, nil
1666}
1667
1668func ObjectDatabase(osEnv, gitEnv Environment, gitdir, tempdir string) (*gitobj.ObjectDatabase, error) {
1669 var options []gitobj.Option

Callers 2

ensureWorkingCopyCleanFunction · 0.92
dedupCommandFunction · 0.92

Calls 2

IsBareFunction · 0.85
gitSimpleFunction · 0.85

Tested by

no test coverage detected