mingw: give more details about unsafe directory's ownership
commitf755e092e8bf22e7bf3599d59a6a7fa562f6b61b
authorSören Krecker <soekkle@freenet.de>
Mon, 8 Jan 2024 17:38:37 +0000 (8 18:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Jan 2024 16:23:30 +0000 (10 08:23 -0800)
treeafd3c47ef7813b0e592fa24e731c40f1ed036894
parentec583449067bab5b800ecc63926f35c9dae96fa1
mingw: give more details about unsafe directory's ownership

Add domain/username in error message, if owner sid of repository and
user sid are not equal on windows systems.

Old error message:
'''
fatal: detected dubious ownership in repository at 'C:/Users/test/source/repos/git'
'C:/Users/test/source/repos/git' is owned by:
'S-1-5-21-571067702-4104414259-3379520149-500'
but the current user is:
'S-1-5-21-571067702-4104414259-3379520149-1001'
To add an exception for this directory, call:

git config --global --add safe.directory C:/Users/test/source/repos/git
'''

New error message:
'''
fatal: detected dubious ownership in repository at 'C:/Users/test/source/repos/git'
'C:/Users/test/source/repos/git' is owned by:
        DESKTOP-L78JVA6/Administrator (S-1-5-21-571067702-4104414259-3379520149-500)
but the current user is:
        DESKTOP-L78JVA6/test (S-1-5-21-571067702-4104414259-3379520149-1001)
To add an exception for this directory, call:

        git config --global --add safe.directory C:/Users/test/source/repos/git
'''

Signed-off-by: Sören Krecker <soekkle@freenet.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c