Commit 94eaa80
difftool: support repositories with .git-files
Modern versions of "git submodule" use .git-files to setup the
submodule directory. When run in a "git submodule"-created
repository "git difftool --dir-diff" dies with the following
error:
$ git difftool -d HEAD~
fatal: This operation must be run in a work tree
diff --raw --no-abbrev -z HEAD~: command returned error: 128
core.worktree is relative to the .git directory but the logic
in find_worktree() does not account for it.
Use `git rev-parse --show-toplevel` to find the worktree so that
the dir-diff feature works inside a submodule.
Reported-by: Gábor Lipták <[email protected]>
Helped-by: Jens Lehmann <[email protected]>
Helped-by: John Keeping <[email protected]>
Signed-off-by: David Aguilar <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 7bbc4e8 commit 94eaa80
1 file changed
+2
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
44 | 42 | | |
45 | 43 | | |
46 | 44 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 45 | + | |
60 | 46 | | |
61 | 47 | | |
62 | 48 | | |
| |||
418 | 404 | | |
419 | 405 | | |
420 | 406 | | |
421 | | - | |
| 407 | + | |
422 | 408 | | |
423 | 409 | | |
424 | 410 | | |
| |||
0 commit comments