Skip to content

Commit a6225e3

Browse files
committed
Tidy up git worktree fix: lingering test failures & mention in changelog
1 parent e14b341 commit a6225e3

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ system, you must also run the `--upgrade` command in each repository:
3838

3939
- New commands make it easier to add file patterns to .gitattributes:
4040
`transcrypt --add` and `git add-crypt` (#125)
41+
- Improve compatibility with `git worktree` by finding the git directory via
42+
`--git-common-dir` instead of `--git-dir`, requires git version newer than
43+
November 2024 (#186)
4144

4245
### Changed
4346

tests/test_contexts.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function teardown {
7676
[[ $(git config --get diff.crypt.binary) = "true" ]]
7777
[[ $(git config --get merge.renormalize) = "true" ]]
7878

79-
[[ "$(git config --get alias.ls-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-dir)"")"/transcrypt --list' ]]
79+
[[ "$(git config --get alias.ls-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-common-dir)"")"/transcrypt --list' ]]
8080
}
8181

8282
@test "init: show extra context details in --display" {

tests/test_init.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ SETUP_SKIP_INIT_TRANSCRYPT=1
4949
[ "$(git config --get merge.renormalize)" = "true" ]
5050
[ "$(git config --get merge.crypt.name)" = "Merge transcrypt secret files" ]
5151

52-
[ "$(git config --get alias.ls-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-dir)"")"/transcrypt --list' ]
52+
[ "$(git config --get alias.ls-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-common-dir)"")"/transcrypt --list' ]
5353

54-
[ "$(git config --get alias.add-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-dir)"")"/transcrypt --add' ]
54+
[ "$(git config --get alias.add-crypt)" = '!"$(git config transcrypt.crypt-dir 2>/dev/null || printf %s/crypt ""$(git rev-parse --git-common-dir)"")"/transcrypt --add' ]
5555
}
5656

5757
@test "init: show details for --display" {

0 commit comments

Comments
 (0)