Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
53d149c5
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
53d149c5
编写于
11月 07, 2007
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'jc/clean-config'
* jc/clean-config: clean: require -f to do damage by default
上级
f8b7819b
562ca192
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
9 deletion
+22
-9
Documentation/config.txt
Documentation/config.txt
+2
-2
git-clean.sh
git-clean.sh
+5
-1
t/t7201-co.sh
t/t7201-co.sh
+6
-6
t/t7300-clean.sh
t/t7300-clean.sh
+9
-0
未找到文件。
Documentation/config.txt
浏览文件 @
53d149c5
...
...
@@ -345,8 +345,8 @@ branch.<name>.mergeoptions::
supported.
clean.requireForce::
A boolean to make git-clean do nothing unless given -f
or -n. Defaults
to fals
e.
A boolean to make git-clean do nothing unless given -f
or -n. Defaults to tru
e.
color.branch::
A boolean to enable/disable color in the output of
...
...
git-clean.sh
浏览文件 @
53d149c5
...
...
@@ -20,12 +20,16 @@ require_work_tree
ignored
=
ignoredonly
=
cleandir
=
disabled
=
"
`
git config
--bool
clean.requireForce
`
"
rmf
=
"rm -f --"
rmrf
=
"rm -rf --"
rm_refuse
=
"echo Not removing"
echo1
=
"echo"
# requireForce used to default to false but now it defaults to true.
# IOW, lack of explicit "clean.requireForce = false" is taken as
# "clean.requireForce = true".
disabled
=
$(
git config
--bool
clean.requireForce
||
echo true
)
while
test
$#
!=
0
do
case
"
$1
"
in
...
...
t/t7201-co.sh
浏览文件 @
53d149c5
...
...
@@ -77,7 +77,7 @@ test_expect_success "checkout with dirty tree without -m" '
test_expect_success
"checkout -m with dirty tree"
'
git checkout -f master &&
git clean &&
git clean
-f
&&
fill 0 1 2 3 4 5 6 7 8 >one &&
git checkout -m side &&
...
...
@@ -99,7 +99,7 @@ test_expect_success "checkout -m with dirty tree" '
test_expect_success
"checkout -m with dirty tree, renamed"
'
git checkout -f master && git clean &&
git checkout -f master && git clean
-f
&&
fill 1 2 3 4 5 7 8 >one &&
if git checkout renamer
...
...
@@ -121,7 +121,7 @@ test_expect_success "checkout -m with dirty tree, renamed" '
test_expect_success
'checkout -m with merge conflict'
'
git checkout -f master && git clean &&
git checkout -f master && git clean
-f
&&
fill 1 T 3 4 5 6 S 8 >one &&
if git checkout renamer
...
...
@@ -144,7 +144,7 @@ test_expect_success 'checkout -m with merge conflict' '
test_expect_success
'checkout to detach HEAD'
'
git checkout -f renamer && git clean &&
git checkout -f renamer && git clean
-f
&&
git checkout renamer^ &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
...
...
@@ -160,7 +160,7 @@ test_expect_success 'checkout to detach HEAD' '
test_expect_success
'checkout to detach HEAD with branchname^'
'
git checkout -f master && git clean &&
git checkout -f master && git clean
-f
&&
git checkout renamer^ &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
...
...
@@ -176,7 +176,7 @@ test_expect_success 'checkout to detach HEAD with branchname^' '
test_expect_success
'checkout to detach HEAD with HEAD^0'
'
git checkout -f master && git clean &&
git checkout -f master && git clean
-f
&&
git checkout HEAD^0 &&
H=$(git rev-parse --verify HEAD) &&
M=$(git show-ref -s --verify refs/heads/master) &&
...
...
t/t7300-clean.sh
浏览文件 @
53d149c5
...
...
@@ -7,6 +7,8 @@ test_description='git-clean basic tests'
.
./test-lib.sh
git config clean.requireForce no
test_expect_success
'setup'
'
mkdir -p src &&
...
...
@@ -244,6 +246,13 @@ test_expect_success 'git-clean -d -X' '
'
test_expect_success
'clean.requireForce defaults to true'
'
git config --unset clean.requireForce &&
! git-clean
'
test_expect_success
'clean.requireForce'
'
git config clean.requireForce true &&
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录