gitopen

package
v4.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gitopen opens a git repository the way every history-reading feature needs it opened.

go-git's PlainOpen follows a worktree's `.git` file to its private gitdir (`<main>/.git/worktrees/<name>`) but not on to the common dir that holds the object store, so the repository opens cleanly and then fails to find every commit: "object not found". A worktree is the normal way to work on several branches at once, and where coding agents work, so a feature that cannot read history there is broken in practice, not in an edge case. `EnableDotGitCommonDir` is the fix, and it is easy to forget at the one call site that matters, which is why the options live in one place.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(path string, detectParents bool) (*git.Repository, error)

Open opens the repository at path.

With detectParents false, path must be the repository root (as git.PlainOpen requires). With it true, a path anywhere inside a working tree resolves to the repository that contains it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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