Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
github
hub
提交
77fe52b9
H
hub
项目概览
github
/
hub
11 个月 前同步成功
通知
3
Star
22523
Fork
2406
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
hub
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
77fe52b9
编写于
7月 25, 2014
作者:
J
Jingwen Owen Ou
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/master' into merge_master
上级
f1657b0b
b5155fc9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
3 deletion
+19
-3
features/clone.feature
features/clone.feature
+13
-1
features/steps.rb
features/steps.rb
+5
-1
lib/hub/commands.rb
lib/hub/commands.rb
+1
-1
未找到文件。
features/clone.feature
浏览文件 @
77fe52b9
...
...
@@ -94,7 +94,7 @@ Feature: hub clone
Scenario
:
Preview cloning a private repo
When
I successfully run `hub --noop clone -p rtomayko/ronn`
Then the output should contain exactly "git clone git@github.com
:
rtomayko/ronn.git\n"
But
"git clone"
should not be run
But
it should not clone anything
Scenario
:
Clone a private repo
When
I successfully run `hub clone -p rtomayko/ronn`
...
...
@@ -137,6 +137,18 @@ Feature: hub clone
Then "git clone git@github.com
:
sstephenson/rbenv.git"
should
be
run
And
there should be no output
Scenario
:
Preview cloning a repo I have push access to
Given the GitHub API server
:
"""
get('/repos/sstephenson/rbenv') {
json :private => false,
:permissions => { :push => true }
}
"""
When
I successfully run `hub --noop clone sstephenson/rbenv`
Then the output should contain exactly "git clone git@github.com
:
sstephenson/rbenv.git\n"
But
it should not clone anything
Scenario
:
Clone my Enterprise repo
Given
I am
"mifi"
on git.my.org with OAuth token
"FITOKEN"
And
$GITHUB_HOST is
"git.my.org"
...
...
features/steps.rb
浏览文件 @
77fe52b9
...
...
@@ -141,8 +141,12 @@ Then(/^it should clone "([^"]*)"$/) do |repo|
step
%("git clone #{repo}" should be run)
end
Then
(
/^it should not clone anything$/
)
do
history
.
each
{
|
h
|
expect
(
h
).
to_not
match
(
/^git clone/
)
}
end
Then
(
/^"([^"]+)" should not be run$/
)
do
|
pattern
|
history
.
all?
{
|
h
|
expect
(
h
).
to_not
include
(
pattern
)
}
history
.
each
{
|
h
|
expect
(
h
).
to_not
include
(
pattern
)
}
end
Then
(
/^there should be no output$/
)
do
...
...
lib/hub/commands.rb
浏览文件 @
77fe52b9
...
...
@@ -294,7 +294,7 @@ module Hub
name
,
owner
=
arg
,
nil
owner
,
name
=
name
.
split
(
'/'
,
2
)
if
name
.
index
(
'/'
)
project
=
github_project
(
name
,
owner
||
github_user
)
unless
ssh
||
args
[
0
]
==
'submodule'
||
args
.
noop?
||
https_protocol?
unless
ssh
||
args
[
0
]
==
'submodule'
||
https_protocol?
repo_info
=
api_client
.
repo_info
(
project
)
ssh
=
repo_info
.
success?
&&
(
repo_info
.
data
[
'private'
]
||
repo_info
.
data
[
'permissions'
][
'push'
])
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录