Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(repo): make sure --git-dir is always provided --work-tree #1203

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

lewis6991
Copy link
Owner

gitdir and worktree must be provided together. From man git:

Specifying the location of the ".git" directory using this option (or GIT_DIR environment
variable) turns off the repository discovery that tries to find a directory with ".git"
subdirectory (which is how the repository and the top-level of the working tree are
discovered), and tells Git that you are at the top level of the working tree. If you are
not at the top-level directory of the working tree, you should tell Git where the
top-level of the working tree is, with the --work-tree= option (or GIT_WORK_TREE
environment variable)

If not then toplevel can be incorrectly calculated.

gitdir and worktree must be provided together. From `man git`:
> Specifying the location of the ".git" directory using this option (or GIT_DIR environment
> variable) turns off the repository discovery that tries to find a directory with ".git"
> subdirectory (which is how the repository and the top-level of the working tree are
> discovered), and tells Git that you are at the top level of the working tree. If you are
> not at the top-level directory of the working tree, you should tell Git where the
> top-level of the working tree is, with the --work-tree=<path> option (or GIT_WORK_TREE
> environment variable)

If not then toplevel can be incorrectly calculated.
@lewis6991 lewis6991 merged commit 310018d into main Feb 5, 2025
7 checks passed
@lewis6991 lewis6991 deleted the fix/gitdirrepo branch February 5, 2025 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant