Skip to content

Commit 7bacc2c

Browse files
committed
Use subshell to prevent active dir change
1 parent 888c8ae commit 7bacc2c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

share/github-backup-utils/ghe-ssh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ if [ -z "$GHE_DISABLE_SSH_MUX" ]; then
6262
opts="-o ControlMaster=auto -o ControlPath=\"$controlpath\" -o ControlPersist=10m -o ServerAliveInterval=10 $opts"
6363
# Workaround for https://bugzilla.mindrot.org/show_bug.cgi?id=1988
6464
if ! [ -S $controlpath ]; then
65-
cd "$TMPDIR"
66-
ssh -f -p $port $opts -o BatchMode=yes "$host" -- /bin/true 1>/dev/null 2>&1 || true
65+
( cd "$TMPDIR" && ssh -f -p $port $opts -o BatchMode=yes "$host" -- /bin/true 1>/dev/null 2>&1 || true )
6766
fi
6867
fi
6968

0 commit comments

Comments
 (0)