Skip to content

Commit 114e91c

Browse files
committed
improve journey test to validate handling ambiguous of ssh-hosts
1 parent b06a0dd commit 114e91c

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

tests/journey/gix.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,12 @@ title "gix commit-graph"
345345
}
346346
)
347347
)
348+
(with "an ambiguous ssh host which could be mistaken for an argument"
349+
it "fails without trying to pass it to command-line programs" && {
350+
WITH_SNAPSHOT="$snapshot/fail-ambigous-host" \
351+
expect_run $WITH_FAILURE "$exe_plumbing" free pack receive 'ssh://-oProxyCommand=open$IFS-aCalculator/foo'
352+
}
353+
)
348354
fi
349355
)
350356
elif [[ "$kind" = "small" ]]; then
@@ -355,6 +361,17 @@ title "gix commit-graph"
355361
fi
356362
)
357363
)
364+
if test "$kind" = "max" || test "$kind" = "max-pure"; then
365+
(with "the 'clone' sub-command"
366+
snapshot="$snapshot/clone"
367+
(with "an ambiguous ssh host which could be mistaken for an argument"
368+
it "fails without trying to pass it to command-line programs" && {
369+
WITH_SNAPSHOT="$snapshot/fail-ambigous-host" \
370+
expect_run $WITH_FAILURE "$exe_plumbing" clone 'ssh://-oProxyCommand=open$IFS-aCalculator/foo'
371+
}
372+
)
373+
)
374+
fi
358375
(with "the 'index' sub-command"
359376
snapshot="$snapshot/index"
360377
title "gix free pack index create"

tests/snapshots/plumbing/no-repo/pack/clone/fail-ambigous-host

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Error: Host name '-oProxyCommand=open$IFS-aCalculator' could be mistaken for a command-line argument
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Error: Host name '-oProxyCommand=open$IFS-aCalculator' could be mistaken for a command-line argument

0 commit comments

Comments
 (0)