sapling/eden/scm/tests/test-hggit-git-clone.t
Durham Goode 9778811573 tags: remove tags feature
Summary:
We no longer user tags in any of our repositories, so let's delete all
the code and remove some tech debt.

Previously drawdag was our last remaining use of tags, but in a previous diff I
switched that to use bookmarks.

Reviewed By: quark-zju

Differential Revision: D19042226

fbshipit-source-id: d7871c71c1026599aa70fdd806418347ea214a8a
2020-01-07 12:31:10 -08:00

61 lines
1.9 KiB
Perl

Load commonly used test logic
$ . "$TESTDIR/hggit/testutil"
$ git init gitrepo
Initialized empty Git repository in $TESTTMP/gitrepo/.git/
$ cd gitrepo
$ echo alpha > alpha
$ git add alpha
$ fn_git_commit -m 'add alpha'
$ echo beta > beta
$ git add beta
$ fn_git_commit -m 'add beta'
$ 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
$ hg -R hgrepo log --graph
@ changeset: 1:3bb02b6794dd
| bookmark: master
| user: test <test@example.org>
| date: Mon Jan 01 00:00:11 2007 +0000
| summary: add beta
|
o changeset: 0:69982ec78c6d
user: test <test@example.org>
date: Mon Jan 01 00:00:10 2007 +0000
summary: add alpha
we should have some bookmarks
$ hg -R hgrepo book
* master 1:3bb02b6794dd
$ hg -R hgrepo gverify
verifying rev 3bb02b6794dd against git commit 9497a4ee62e16ee641860d7677cdb2589ea15554
test for ssh vulnerability
$ cat >> $HGRCPATH << EOF
> [ui]
> ssh = ssh -o ConnectTimeout=1
> EOF
$ hg clone 'git+ssh://-oProxyCommand=rm${IFS}nonexistent/path' 2>&1 >/dev/null
abort: potentially unsafe hostname: '-oProxyCommand=rm${IFS}nonexistent'
[255]
$ hg clone 'git+ssh://%2DoProxyCommand=rm${IFS}nonexistent/path' 2>&1 >/dev/null
abort: potentially unsafe hostname: '-oProxyCommand=rm${IFS}nonexistent'
[255]
$ hg clone 'git+ssh://fakehost|rm${IFS}nonexistent/path'
ssh: .* fakehost%7[Cc]rm%24%7[Bb][Ii][Ff][Ss]%7[Dd]nonexistent.* (re)
destination directory: path
abort: git remote error: The remote server unexpectedly closed the connection.
[255]
$ hg clone 'git+ssh://fakehost%7Crm${IFS}nonexistent/path'
ssh: .* fakehost%7[cC]rm%24%7[Bb][Ii][Ff][Ss]%7[Dd]nonexistent.* (re)
destination directory: path
abort: git remote error: The remote server unexpectedly closed the connection.
[255]