interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t5810-proto-disable-local.sh

38 lines · 1032 bytes Raw Blame History
1#!/bin/sh
2
3test_description='test disabling of local paths in clone/fetch'
4
5. ./test-lib.sh
6. "$TEST_DIRECTORY/lib-proto-disable.sh"
7
8test_expect_success 'setup repository to clone' '
9 test_commit one
10'
11
12test_proto "file://" file "file://$PWD"
13test_proto "path" file .
14
15test_expect_success 'setup repo with dash' '
16 git init --bare repo.git &&
17 git push repo.git HEAD &&
18 mv repo.git "$PWD/-repo.git"
19'
20
21# This will fail even without our rejection because upload-pack will
22# complain about the bogus option. So let's make sure that GIT_TRACE
23# doesn't show us even running upload-pack.
24#
25# We must also be sure to use "fetch" and not "clone" here, as the latter
26# actually canonicalizes our input into an absolute path (which is fine
27# to allow).
28test_expect_success 'repo names starting with dash are rejected' '
29 rm -f trace.out &&
30 test_must_fail env GIT_TRACE="$PWD/trace.out" git fetch -- -repo.git &&
31 test_grep ! upload-pack trace.out
32'
33
34test_expect_success 'full paths still work' '
35 git fetch "$PWD/-repo.git"
36'
37
38test_done