elasticdog / transcrypt

transparently encrypt files within a git repository
MIT License
1.48k stars 102 forks source link

test fails due to assumed branch name #143

Closed ljm42 closed 2 years ago

ljm42 commented 2 years ago

The test merge: branches with encrypted file - line changes both branches, with conflicts assumes the initial branch is named "main": https://github.com/elasticdog/transcrypt/blob/00a2cbb660f9e47e553159d3cb9461f226100c8a/tests/test_merge.bats#L93

That means if you haven't set the defaultBranch, or if you set it to something other than main: git config --global init.defaultBranch trunk the test will fail.

A backwards compatible fix is right after this line: https://github.com/elasticdog/transcrypt/blob/00a2cbb660f9e47e553159d3cb9461f226100c8a/tests/_test_helper.bash#L10 add: git checkout -b main

This is another option, but it requires a fairly recent version of git: git init --initial-branch=main "$BATS_TEST_DIRNAME"

( thanks to https://stackoverflow.com/a/42871621 )

jmurty commented 2 years ago

Fixed in #144 now merged