-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli: git: store absolute remote path in config file
The "git" CLI chdir()s to the work tree root, so paths in config file are usually resolved relative to the workspace root. OTOH, jj doesn't modify the process environment, so libgit2 resolves remote paths relative to cwd, not to the workspace root. To mitigate the problem, this patch makes "jj git remote" sub commands to store resolved path in .git/config. It would be nice if we can reconfigure in-memory git2 remote object to use absolute paths (or set up in-memory named remote without writing a config file), but there's no usable API afaik. This behavior is different from "git remote add"/"set-url". I don't know the rationale, but these commands don't resolve relative paths, whereas "git clone" writes resolved path to .git/config. I think it's more consistent to make all "jj git" sub commands resolve relative paths.
- Loading branch information
Showing
6 changed files
with
52 additions
and
6 deletions.
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
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