]> git.ipfire.org Git - thirdparty/git.git/blame - t/t5580-clone-push-unc.sh
Merge branch 'ar/request-pull-phrasofix' into maint
[thirdparty/git.git] / t / t5580-clone-push-unc.sh
CommitLineData
16615f0f
JS
1#!/bin/sh
2
13b57da8 3test_description='various Windows-only path tests'
16615f0f
JS
4. ./test-lib.sh
5
6if ! test_have_prereq MINGW; then
13b57da8 7 skip_all='skipping Windows-only path tests'
16615f0f
JS
8 test_done
9fi
10
11UNCPATH="$(pwd)"
12case "$UNCPATH" in
13[A-Z]:*)
14 # Use administrative share e.g. \\localhost\C$\git-sdk-64\usr\src\git
15 # (we use forward slashes here because MSYS2 and Git accept them, and
16 # they are easier on the eyes)
17 UNCPATH="//localhost/${UNCPATH%%:*}\$/${UNCPATH#?:}"
18 test -d "$UNCPATH" || {
19 skip_all='could not access administrative share; skipping'
20 test_done
21 }
22 ;;
23*)
24 skip_all='skipping UNC path tests, cannot determine current path as UNC'
25 test_done
26 ;;
27esac
28
29test_expect_success setup '
30 test_commit initial
31'
32
33test_expect_success clone '
34 git clone "file://$UNCPATH" clone
35'
36
37test_expect_success push '
38 (
39 cd clone &&
40 git checkout -b to-push &&
41 test_commit to-push &&
42 git push origin HEAD
43 ) &&
44 rev="$(git -C clone rev-parse --verify refs/heads/to-push)" &&
45 test "$rev" = "$(git rev-parse --verify refs/heads/to-push)"
46'
47
e5b31344 48test_expect_success 'remote nick cannot contain backslashes' '
13b57da8
JS
49 BACKSLASHED="$(pwd | tr / \\\\)" &&
50 git ls-remote "$BACKSLASHED" >out 2>err &&
51 test_i18ngrep ! "unable to access" err
52'
53
16615f0f 54test_done