提交 f9c2d2b1 编写于 作者: J Junio C Hamano

Merge branch 'nd/maint-remote-remove' into maint

* nd/maint-remote-remove:
  remote: prefer subcommand name 'remove' to 'rm'
...@@ -12,7 +12,7 @@ SYNOPSIS ...@@ -12,7 +12,7 @@ SYNOPSIS
'git remote' [-v | --verbose] 'git remote' [-v | --verbose]
'git remote add' [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url> 'git remote add' [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>
'git remote rename' <old> <new> 'git remote rename' <old> <new>
'git remote rm' <name> 'git remote remove' <name>
'git remote set-head' <name> (-a | -d | <branch>) 'git remote set-head' <name> (-a | -d | <branch>)
'git remote set-branches' [--add] <name> <branch>... 'git remote set-branches' [--add] <name> <branch>...
'git remote set-url' [--push] <name> <newurl> [<oldurl>] 'git remote set-url' [--push] <name> <newurl> [<oldurl>]
...@@ -85,6 +85,7 @@ In case <old> and <new> are the same, and <old> is a file under ...@@ -85,6 +85,7 @@ In case <old> and <new> are the same, and <old> is a file under
`$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to `$GIT_DIR/remotes` or `$GIT_DIR/branches`, the remote is converted to
the configuration file format. the configuration file format.
'remove'::
'rm':: 'rm'::
Remove the remote named <name>. All remote-tracking branches and Remove the remote named <name>. All remote-tracking branches and
......
...@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = { ...@@ -11,7 +11,7 @@ static const char * const builtin_remote_usage[] = {
"git remote [-v | --verbose]", "git remote [-v | --verbose]",
"git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>", "git remote add [-t <branch>] [-m <master>] [-f] [--tags|--no-tags] [--mirror=<fetch|push>] <name> <url>",
"git remote rename <old> <new>", "git remote rename <old> <new>",
"git remote rm <name>", "git remote remove <name>",
"git remote set-head <name> (-a | -d | <branch>)", "git remote set-head <name> (-a | -d | <branch>)",
"git remote [-v | --verbose] show [-n] <name>", "git remote [-v | --verbose] show [-n] <name>",
"git remote prune [-n | --dry-run] <name>", "git remote prune [-n | --dry-run] <name>",
...@@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = { ...@@ -34,7 +34,7 @@ static const char * const builtin_remote_rename_usage[] = {
}; };
static const char * const builtin_remote_rm_usage[] = { static const char * const builtin_remote_rm_usage[] = {
"git remote rm <name>", "git remote remove <name>",
NULL NULL
}; };
...@@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix) ...@@ -1580,7 +1580,7 @@ int cmd_remote(int argc, const char **argv, const char *prefix)
result = add(argc, argv); result = add(argc, argv);
else if (!strcmp(argv[0], "rename")) else if (!strcmp(argv[0], "rename"))
result = mv(argc, argv); result = mv(argc, argv);
else if (!strcmp(argv[0], "rm")) else if (!strcmp(argv[0], "rm") || !strcmp(argv[0], "remove"))
result = rm(argc, argv); result = rm(argc, argv);
else if (!strcmp(argv[0], "set-head")) else if (!strcmp(argv[0], "set-head"))
result = set_head(argc, argv); result = set_head(argc, argv);
......
...@@ -2040,7 +2040,7 @@ _git_config () ...@@ -2040,7 +2040,7 @@ _git_config ()
_git_remote () _git_remote ()
{ {
local subcommands="add rename rm set-head set-branches set-url show prune update" local subcommands="add rename remove set-head set-branches set-url show prune update"
local subcommand="$(__git_find_on_cmdline "$subcommands")" local subcommand="$(__git_find_on_cmdline "$subcommands")"
if [ -z "$subcommand" ]; then if [ -z "$subcommand" ]; then
__gitcomp "$subcommands" __gitcomp "$subcommands"
...@@ -2048,7 +2048,7 @@ _git_remote () ...@@ -2048,7 +2048,7 @@ _git_remote ()
fi fi
case "$subcommand" in case "$subcommand" in
rename|rm|set-url|show|prune) rename|remove|set-url|show|prune)
__gitcomp_nl "$(__git_remotes)" __gitcomp_nl "$(__git_remotes)"
;; ;;
set-head|set-branches) set-head|set-branches)
......
...@@ -125,7 +125,7 @@ EOF ...@@ -125,7 +125,7 @@ EOF
} && } &&
git tag footag && git tag footag &&
git config --add remote.oops.fetch "+refs/*:refs/*" && git config --add remote.oops.fetch "+refs/*:refs/*" &&
git remote rm oops 2>actual1 && git remote remove oops 2>actual1 &&
git branch foobranch && git branch foobranch &&
git config --add remote.oops.fetch "+refs/*:refs/*" && git config --add remote.oops.fetch "+refs/*:refs/*" &&
git remote rm oops 2>actual2 && git remote rm oops 2>actual2 &&
...@@ -672,7 +672,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' ' ...@@ -672,7 +672,7 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/remotes' '
git clone one five && git clone one five &&
origin_url=$(pwd)/one && origin_url=$(pwd)/one &&
(cd five && (cd five &&
git remote rm origin && git remote remove origin &&
mkdir -p .git/remotes && mkdir -p .git/remotes &&
cat ../remotes_origin > .git/remotes/origin && cat ../remotes_origin > .git/remotes/origin &&
git remote rename origin origin && git remote rename origin origin &&
......
...@@ -109,7 +109,7 @@ test_expect_success 'http-push fetches packed objects' ' ...@@ -109,7 +109,7 @@ test_expect_success 'http-push fetches packed objects' '
# By reset, we force git to retrieve the packed object # By reset, we force git to retrieve the packed object
(cd "$ROOT_PATH"/test_repo_clone_packed && (cd "$ROOT_PATH"/test_repo_clone_packed &&
git reset --hard HEAD^ && git reset --hard HEAD^ &&
git remote rm origin && git remote remove origin &&
git reflog expire --expire=0 --all && git reflog expire --expire=0 --all &&
git prune && git prune &&
git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master) git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册