Merge branch 'nd/maint-remote-remove' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 20 Sep 2012 22:53:31 +0000 (15:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Sep 2012 22:53:31 +0000 (15:53 -0700)
* nd/maint-remote-remove:
remote: prefer subcommand name 'remove' to 'rm'

1  2 
contrib/completion/git-completion.bash
t/t5540-http-push.sh
index 5a5b5a0b3c21f129133614db78ad33299987b11c,ee4c0a07aedb9c587879f7a7bbf1193a24cdd8a2..3b982903491e01b8ca03c1e8f8943f5abc4dc553
@@@ -225,13 -225,6 +225,13 @@@ _get_comp_words_by_ref (
  fi
  fi
  
 +# Quotes the argument for shell reuse
 +__git_quote()
 +{
 +      local quoted=${1//\'/\'\\\'\'}
 +      printf "'%s'" "$quoted"
 +}
 +
  # Generates completion reply with compgen, appending a space to possible
  # completion words, if necessary.
  # It accepts 1 to 4 arguments:
@@@ -268,7 -261,7 +268,7 @@@ __gitcomp (
  __gitcomp_nl ()
  {
        local IFS=$'\n'
 -      COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$1" -- "${3-$cur}"))
 +      COMPREPLY=($(compgen -P "${2-}" -S "${4- }" -W "$(__git_quote "$1")" -- "${3-$cur}"))
  }
  
  __git_heads ()
@@@ -1021,8 -1014,7 +1021,8 @@@ _git_commit (
        --*)
                __gitcomp "
                        --all --author= --signoff --verify --no-verify
 -                      --edit --amend --include --only --interactive
 +                      --edit --no-edit
 +                      --amend --include --only --interactive
                        --dry-run --reuse-message= --reedit-message=
                        --reset-author --file= --message= --template=
                        --cleanup= --untracked-files --untracked-files=
@@@ -2040,7 -2032,7 +2040,7 @@@ _git_config (
  
  _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")"
        if [ -z "$subcommand" ]; then
                __gitcomp "$subcommands"
        fi
  
        case "$subcommand" in
-       rename|rm|set-url|show|prune)
+       rename|remove|set-url|show|prune)
                __gitcomp_nl "$(__git_remotes)"
                ;;
        set-head|set-branches)
diff --combined t/t5540-http-push.sh
index f141f2d1da3ca8186ccc7a742bddd06f2e7f8970,7c14bc4811d53e3bd132bbbf7b72c8b97747ca69..01d0d95b4d6476f691f650cc413fa7156caee88b
@@@ -46,7 -46,15 +46,7 @@@ test_expect_success 'create password-pr
               "$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git"
  '
  
 -test_expect_success 'setup askpass helper' '
 -      cat >askpass <<-\EOF &&
 -      #!/bin/sh
 -      echo user@host
 -      EOF
 -      chmod +x askpass &&
 -      GIT_ASKPASS="$PWD/askpass" &&
 -      export GIT_ASKPASS
 -'
 +setup_askpass_helper
  
  test_expect_success 'clone remote repository' '
        cd "$ROOT_PATH" &&
@@@ -109,7 -117,7 +109,7 @@@ test_expect_success 'http-push fetches 
        # By reset, we force git to retrieve the packed object
        (cd "$ROOT_PATH"/test_repo_clone_packed &&
         git reset --hard HEAD^ &&
-        git remote rm origin &&
+        git remote remove origin &&
         git reflog expire --expire=0 --all &&
         git prune &&
         git push -f -v $HTTPD_URL/dumb/test_repo_packed.git master)
@@@ -154,7 -162,6 +154,7 @@@ test_http_push_nonff "$HTTPD_DOCUMENT_R
  
  test_expect_success 'push to password-protected repository (user in URL)' '
        test_commit pw-user &&
 +      set_askpass user@host &&
        git push "$HTTPD_URL_USER/auth/dumb/test_repo.git" HEAD &&
        git rev-parse --verify HEAD >expect &&
        git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git" \
        test_cmp expect actual
  '
  
 +test_expect_failure 'user was prompted only once for password' '
 +      expect_askpass pass user@host
 +'
 +
  test_expect_failure 'push to password-protected repository (no user in URL)' '
        test_commit pw-nouser &&
 +      set_askpass user@host &&
        git push "$HTTPD_URL/auth/dumb/test_repo.git" HEAD &&
 +      expect_askpass both user@host
        git rev-parse --verify HEAD >expect &&
        git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/auth/dumb/test_repo.git" \
                rev-parse --verify HEAD >actual &&