Imported Upstream version 2.4.2
[scm/test.git] / t / t-ssh.sh
1 #!/usr/bin/env bash
2
3 . "$(dirname "$0")/testlib.sh"
4
5 begin_test "ssh with proxy command in lfs.url"
6 (
7   set -e
8
9   reponame="batch-ssh-proxy"
10   setup_remote_repo "$reponame"
11   clone_repo "$reponame" "$reponame"
12
13   sshurl="${GITSERVER/http:\/\//ssh://-oProxyCommand=ssh-proxy-test/}/$reponame"
14   echo $sshurl
15   git config lfs.url "$sshurl"
16
17   contents="test"
18   oid="$(calc_oid "$contents")"
19   git lfs track "*.dat"
20   printf "$contents" > test.dat
21   git add .gitattributes test.dat
22   git commit -m "initial commit"
23
24   git push origin master 2>&1 | tee push.log
25   if [ "0" -eq "${PIPESTATUS[0]}" ]; then
26     echo >&2 "fatal: push succeeded"
27     exit 1
28   fi
29
30   grep "got 4 args" push.log
31   grep "lfs-ssh-echo -- -oProxyCommand" push.log
32 )
33 end_test