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

Working directory calculation is broken when in a subdirectory of submodule #459

Closed
mateusz-holenko opened this issue Nov 24, 2015 · 0 comments

Comments

@mateusz-holenko
Copy link

When tig is started from a subdirectory of a repository's submodule it is impossible to e.g., open the file in text editor (using e key) as it says that the file does not exist. Here is an example files tree:

repository_directory
+-> file1
+-> file2
+-+ submodule_folder
  +-> file3
  +-+ dir1
    +-> file4

When file4 is modified and tig is run from submodule_folder everything works fine. But when it is run from dir1 text editor cannot open it (as it does not exist).

After analyzing source code I managed to narrow the problem down to core.worktree and repo.cdup which seems to conflict and change current working directory twice. Quick fix of commenting out core.worktree works for me, but I assume it will brake support for repositories with multiple working trees.

jonas added a commit that referenced this issue May 20, 2018
Add tests for simple use of submodules and worktrees together with
editors from subdirectories.

Closes #783
Closes #508
@jonas jonas closed this as completed in 625bb58 May 20, 2018
rolandwalker pushed a commit to rolandwalker/tig that referenced this issue May 21, 2018
Add tests for simple use of submodules and worktrees together with
editors from subdirectories.

Closes jonas#783
Closes jonas#508
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

No branches or pull requests

1 participant