forked from git-for-windows/git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "aliases vs pre-command hook" issue
It was reported that the pre-command hook is not called as expected when running aliases in subdirectories. Turns out that handle_alias() nastily initializes the Git directory, and then tries (incompletely) to restore the state beforehand. Let's do a more thorough job at restoring the state. An alternative approach would be to avoid calling setup_git_directory_gently() *just* to read the alias' expansion, using discover_git_directory_gently(). But that method is fraught with peril, as e.g. "external" aliases, i.e. aliases starting with an exclamation point expect to be called in the top-level directory of the current worktree (and set GIT_PREFIX accordingly), if any. Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
- Loading branch information
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters