-
Notifications
You must be signed in to change notification settings - Fork 141
stash apply: be prepared to run in a worktree's subdirectory #354
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
Conversation
/submit |
Submitted as [email protected] |
This branch is now known as |
This patch series was integrated into pu via git@be1984d. |
This patch series was integrated into pu via git@89ae45e. |
When Git wants to spawn a child Git process inside a worktree's subdirectory while `GIT_DIR` is set, we need to take care of specifying the work tree's top-level directory explicitly because it cannot be discovered: the current directory is _not_ the top-level directory of the work tree, and neither is it inside the parent directory of `GIT_DIR`. This fixes the problem where `git stash apply` would report pretty much everything deleted or untracked when run inside a worktree's subdirectory. To make sure that we do not introduce the "reverse problem", i.e. when `GIT_WORK_TREE` is defined but `GIT_DIR` is not, we simply make sure that both are set. Signed-off-by: Johannes Schindelin <[email protected]>
a687c16
to
4e19436
Compare
/submit |
Submitted as [email protected] |
This patch series was integrated into pu via git@d30cef4. |
This patch series was integrated into pu via git@2a166ea. |
This patch series was integrated into next via git@b3474c9. |
This patch series was integrated into pu via git@233bd9d. |
This patch series was integrated into pu via git@04d4789. |
This patch series was integrated into pu via git@ecaa71c. |
This patch series was integrated into pu via git@66102cf. |
This patch series was integrated into next via git@66102cf. |
This patch series was integrated into master via git@66102cf. |
Closed via 66102cf. |
I saw this issue a couple times in my setup, and always wondered why nobody else seemed to be hit by this. When I finally found/made some time to investigate, I found out that it really requires a specific setup: I have many worktrees connected to my main git.git clone, often run inside
t/
and I do stash quite often (now thatgit stash
's performance is a joy on Windows).Changes since v1:
GIT_DIR
.