Remove unused field: Repository.real (#1936)

This commit is contained in:
Denis Bilenko 2024-11-27 13:14:39 +01:00 committed by GitHub
parent fae1b6742d
commit e57cbf1273
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 7 deletions

View File

@ -19,10 +19,6 @@ var GitDirectoryName = ".git"
// Repository represents a Git repository or a directory // Repository represents a Git repository or a directory
// that could later be initialized as Git repository. // that could later be initialized as Git repository.
type Repository struct { type Repository struct {
// real indicates if this is a real repository or a non-Git
// directory where we process .gitignore files.
real bool
// rootDir is the path to the root of the repository checkout. // rootDir is the path to the root of the repository checkout.
// This can be either the main repository checkout or a worktree checkout. // This can be either the main repository checkout or a worktree checkout.
// For more information about worktrees, see: https://git-scm.com/docs/git-worktree#_description. // For more information about worktrees, see: https://git-scm.com/docs/git-worktree#_description.
@ -209,7 +205,6 @@ func (r *Repository) Ignore(relPath string) (bool, error) {
} }
func NewRepository(path vfs.Path) (*Repository, error) { func NewRepository(path vfs.Path) (*Repository, error) {
real := true
rootDir, err := vfs.FindLeafInTree(path, GitDirectoryName) rootDir, err := vfs.FindLeafInTree(path, GitDirectoryName)
if err != nil { if err != nil {
if !errors.Is(err, fs.ErrNotExist) { if !errors.Is(err, fs.ErrNotExist) {
@ -217,7 +212,6 @@ func NewRepository(path vfs.Path) (*Repository, error) {
} }
// Cannot find `.git` directory. // Cannot find `.git` directory.
// Treat the specified path as a potential repository root checkout. // Treat the specified path as a potential repository root checkout.
real = false
rootDir = path rootDir = path
} }
@ -229,7 +223,6 @@ func NewRepository(path vfs.Path) (*Repository, error) {
} }
repo := &Repository{ repo := &Repository{
real: real,
rootDir: rootDir, rootDir: rootDir,
gitDir: gitDir, gitDir: gitDir,
gitCommonDir: gitCommonDir, gitCommonDir: gitCommonDir,