gitpath

package
v0.121.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package gitpath answers whether a path lies inside a Git working tree or a bare Git repository. Private stores (evidence snapshots, query results) refuse such a location, so private bytes never end up next to files a person might commit or push.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Inside

func Inside(path string, lstat Lstat) (bool, error)

Inside reports whether path, or any of its ancestors, is a Git working tree (holds .git) or a bare repository (holds HEAD, objects and refs). A path that is a file is judged by its folder; a path that does not exist yet is judged by its spelling.

func IsBare

func IsBare(path string, lstat Lstat) (bool, error)

IsBare reports whether path holds the HEAD, objects and refs of a bare Git repository.

Types

type Lstat

type Lstat func(name string) (os.FileInfo, error)

Lstat is the file-information call the checks use; the stores pass their own seam so their tests can inject failures.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL