2012-10-31 04:03:26 +04:00
|
|
|
Load commonly used test logic
|
2018-01-09 17:08:01 +03:00
|
|
|
$ . "$TESTDIR/hggit/testutil"
|
2012-10-31 04:03:26 +04:00
|
|
|
|
2012-10-31 08:01:03 +04:00
|
|
|
$ git init gitrepo
|
2012-09-14 04:49:42 +04:00
|
|
|
Initialized empty Git repository in $TESTTMP/gitrepo/.git/
|
2012-10-31 08:01:03 +04:00
|
|
|
$ cd gitrepo
|
2012-09-10 08:26:59 +04:00
|
|
|
$ echo alpha > alpha
|
|
|
|
$ git add alpha
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'add alpha'
|
2012-09-10 08:26:59 +04:00
|
|
|
$ echo beta > beta
|
|
|
|
$ git add beta
|
2012-10-31 06:59:20 +04:00
|
|
|
$ fn_git_commit -m 'add beta'
|
2012-09-10 08:26:59 +04:00
|
|
|
|
|
|
|
$ cd ..
|
|
|
|
|
|
|
|
$ hg clone gitrepo hgrepo | grep -v '^updating'
|
|
|
|
importing git objects into hg
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
2015-03-12 20:29:58 +03:00
|
|
|
$ hg -R hgrepo log --graph
|
2018-12-06 23:00:57 +03:00
|
|
|
@ changeset: 1:3bb02b6794dd
|
2015-03-12 20:29:58 +03:00
|
|
|
| bookmark: master
|
2012-09-10 08:26:59 +04:00
|
|
|
| tag: default/master
|
|
|
|
| tag: tip
|
|
|
|
| user: test <test@example.org>
|
|
|
|
| date: Mon Jan 01 00:00:11 2007 +0000
|
|
|
|
| summary: add beta
|
|
|
|
|
|
2018-12-06 23:00:57 +03:00
|
|
|
o changeset: 0:69982ec78c6d
|
2012-09-10 08:26:59 +04:00
|
|
|
user: test <test@example.org>
|
|
|
|
date: Mon Jan 01 00:00:10 2007 +0000
|
|
|
|
summary: add alpha
|
|
|
|
|
|
|
|
|
2012-11-04 03:14:17 +04:00
|
|
|
we should have some bookmarks
|
2012-11-04 03:12:08 +04:00
|
|
|
$ hg -R hgrepo book
|
2018-12-06 23:00:57 +03:00
|
|
|
* master 1:3bb02b6794dd
|
2014-02-27 02:19:24 +04:00
|
|
|
$ hg -R hgrepo gverify
|
2018-12-06 23:00:57 +03:00
|
|
|
verifying rev 3bb02b6794dd against git commit 9497a4ee62e16ee641860d7677cdb2589ea15554
|
2017-08-05 00:34:57 +03:00
|
|
|
|
|
|
|
test for ssh vulnerability
|
|
|
|
|
2017-08-10 21:19:04 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [ui]
|
|
|
|
> ssh = ssh -o ConnectTimeout=1
|
|
|
|
> EOF
|
|
|
|
|
|
|
|
$ hg clone 'git+ssh://-oProxyCommand=rm${IFS}nonexistent/path' 2>&1 >/dev/null
|
2017-08-05 00:34:57 +03:00
|
|
|
abort: potentially unsafe hostname: '-oProxyCommand=rm${IFS}nonexistent'
|
2017-08-10 21:19:04 +03:00
|
|
|
[255]
|
|
|
|
$ hg clone 'git+ssh://%2DoProxyCommand=rm${IFS}nonexistent/path' 2>&1 >/dev/null
|
2017-08-05 00:34:57 +03:00
|
|
|
abort: potentially unsafe hostname: '-oProxyCommand=rm${IFS}nonexistent'
|
2017-08-10 21:19:04 +03:00
|
|
|
[255]
|
2018-01-09 16:53:20 +03:00
|
|
|
$ hg clone 'git+ssh://fakehost|rm${IFS}nonexistent/path'
|
2019-02-15 00:12:45 +03:00
|
|
|
ssh: .* fakehost%7[Cc]rm%24%7[Bb][Ii][Ff][Ss]%7[Dd]nonexistent.* (re)
|
2018-01-09 16:53:20 +03:00
|
|
|
destination directory: path
|
2017-08-10 21:19:04 +03:00
|
|
|
abort: git remote error: The remote server unexpectedly closed the connection.
|
2018-01-09 16:53:20 +03:00
|
|
|
[255]
|
|
|
|
$ hg clone 'git+ssh://fakehost%7Crm${IFS}nonexistent/path'
|
2019-02-15 00:12:45 +03:00
|
|
|
ssh: .* fakehost%7[cC]rm%24%7[Bb][Ii][Ff][Ss]%7[Dd]nonexistent.* (re)
|
2018-01-09 16:53:20 +03:00
|
|
|
destination directory: path
|
2017-08-10 21:19:04 +03:00
|
|
|
abort: git remote error: The remote server unexpectedly closed the connection.
|
2018-01-09 16:53:20 +03:00
|
|
|
[255]
|