<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>Cause: set_git tries to guess the git top-level folder but fails in subdir.</div><div><br></div><div>Solution: <span class="nv">INNER_GIT_DIR</span><span class="o">=</span>$(git -C "<span class="si">${</span><span class="nv">1</span><span class="p">%/*</span><span class="si">}" </span>rev-parse --show-toplevel 2>/dev/null || true)</div><div><br></div><div>This will also handle submodules, in a fashion.</div><div><br></div><div>Steps to repeat:</div><div><br></div><div>$ cd /tmp</div><div>$ mkdir pass-test</div><div>$ cd pass-test</div><div>$ PASSWORD_STORE_DIR=. pass init **********</div><div>Password store initialized for **********</div><div>$ git init .</div><div>Initialized empty Git repository in /tmp/pass-test/.git/</div><div>$ mkdir -p some/folder</div><div>$ PASSWORD_STORE_DIR=. pass insert some/folder/test</div><div>Enter password for some/folder/test:</div><div>Retype password for some/folder/test:</div><div>fatal: pathspec './some/folder/test.gpg' did not match any files</div><div>$ git status</div><div>On branch master</div><div>Untracked files:</div><div> (use "git add <file>..." to include in what will be committed)</div><div><br></div><div> .gpg-id</div><div> some/</div><div><br></div><div>nothing added to commit but untracked files present (use "git add" to track)</div><div>$ pass --version</div><div>============================================</div><div>= pass: the standard unix password manager =</div><div>= =</div><div>= v1.7.3 =</div><div>= =</div><div>= Jason A. Donenfeld =</div><div>= <a href="mailto:Jason@zx2c4.com">Jason@zx2c4.com</a> =</div><div>= =</div><div>= <a href="http://www.passwordstore.org/">http://www.passwordstore.org/</a> =</div><div>============================================</div><div></div><div>$ </div><div><br></div><div><br></div><div></div><div></div></body></html>