Setting PASSWORD_STORE_DIR=. (current directory) causes git commit to fail in subdir

Klaus Rennecke kzhh.pozfh at rennecke.de
Wed Mar 4 13:30:59 CET 2020


Sorry about my noob mistake, reflow killed the plaintext:

Cause: set_git tries to guess the git top-level folder but fails in
subdir.

Solution: INNER_GIT_DIR=$(git -C "${1%/*}" rev-parse --show-toplevel
2>/dev/null || true)

This will also handle submodules, in a fashion.

Steps to repeat:

$ cd /tmp
$ mkdir pass-test
$ cd pass-test
$ PASSWORD_STORE_DIR=. pass init **********
Password store initialized for **********
$ git init .
Initialized empty Git repository in /tmp/pass-test/.git/
$ mkdir -p some/folder
$ PASSWORD_STORE_DIR=. pass insert some/folder/test
Enter password for some/folder/test:
Retype password for some/folder/test:
fatal: pathspec './some/folder/test.gpg' did not match any files
$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

.gpg-id
some/

nothing added to commit but untracked files present (use "git add" to
track)
$ pass --version
============================================
= pass: the standard unix password manager =
=                                          =
=                  v1.7.3                  =
=                                          =
=             Jason A. Donenfeld           =
=               Jason at zx2c4.com            =
=                                          =
=      http://www.passwordstore.org/       =
============================================
$



More information about the Password-Store mailing list