t5580: verify that alternates can be UNC paths
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 25 Feb 2019 14:17:45 +0000 (06:17 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 May 2019 09:40:01 +0000 (18:40 +0900)
On Windows, UNC paths are a very convenient way to share data, and
alternates are all about sharing data.

We fixed a bug where alternates specifying UNC paths were not handled
properly, and it is high time that we add a regression test to ensure
that this bug is not reintroduced.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5580-clone-push-unc.sh
index 217adf3a632b49e9322de1db78c3e1a588c3b7bd..b3c8a92450bc0e9ba869563ef1a7a4c1362cebd6 100755 (executable)
@@ -62,4 +62,16 @@ test_expect_success MINGW 'remote nick cannot contain backslashes' '
        test_i18ngrep ! "unable to access" err
 '
 
+test_expect_success 'unc alternates' '
+       tree="$(git rev-parse HEAD:)" &&
+       mkdir test-unc-alternate &&
+       (
+               cd test-unc-alternate &&
+               git init &&
+               test_must_fail git show $tree &&
+               echo "$UNCPATH/.git/objects" >.git/objects/info/alternates &&
+               git show $tree
+       )
+'
+
 test_done