[PATCH 1/2] Add failing test: deinit an empty subfolder

Timm Fitschen mail at timmfitschen.de
Mon Jun 1 00:03:22 UTC 2026


The test basically calls

    pass init -p some/dir $KEY1

and then

    pass init -p some/dir ""

which should remove the `some/dir/.gpgid` file and empty parent
directories and commit everything to git.

However, both `git` and `find` complain about "No such file or directory"
which is a false positive error and also leaves uncommitted changes in
the git repository.
---
 tests/t0300-reencryption.sh | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tests/t0300-reencryption.sh b/tests/t0300-reencryption.sh
index 3c88987..08dfc97 100755
--- a/tests/t0300-reencryption.sh
+++ b/tests/t0300-reencryption.sh
@@ -106,4 +106,12 @@ test_expect_success 'Git picked up all changes throughout' '
 	[[ -z $(git status --porcelain 2>&1) ]]
 '
 
+test_expect_success 'Deinit empty subfolder' '
+	"$PASS" init -p some/subfolder $KEY1 &> /dev/null &&
+	stderr="$("$PASS" init -p some/subfolder "" 2>&1 1> /dev/null )" &&
+	echo "$stderr" &&
+	[[ ! "$stderr" =~ "No such file or directory" ]] &&
+	[[ -z $(git status --porcelain 2>&1) ]]
+'
+
 test_done
-- 
2.49.0

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 902 bytes
Desc: not available
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20260601/aa04c911/attachment.sig>


More information about the Password-Store mailing list