dirtyvcs: handle multiple git safe.directory
The safe.directory git config can be multi-valued. If several repo paths were added by the dirtyvcs test, the current git config --get safe.directory
will only return the first value, not the whole list. Therefore the if
test will typically fail and add the repo path again. Git itself will also not check if the path is already in the list, and append it to the .gitconfig
. Thus the /var/lib/xymon/.gitconfig
file may increase in size on each run of the dirtyvcs test.
With the additional -all
option all safe.directory values are returned and the if
test works as expected.
Note that git v2.46 has deprecated git config --get-all
in favor of the subcommand git config get --all
. So in upcoming Debian releases one may have to adapt the command accordingly.