X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-pull.sh;h=fb9e2df9312e96ecf8ad5ab2bde4b74b979fe02e;hb=294e15fc19b5ba370b703d003920d000a4f5547a;hp=4e9e0e49ecf2532ac8af1bfd46033e68c6f1042d;hpb=5590fe762ff9d68f6968d80979e446576e61e2e1;p=git.git diff --git a/git-pull.sh b/git-pull.sh index 4e9e0e49e..fb9e2df93 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -168,34 +168,10 @@ error_on_no_merge_candidates () { echo "You asked to pull from the remote '$1', but did not specify" echo "a branch. Because this is not the default configured remote" echo "for your current branch, you must specify a branch on the command line." - elif [ -z "$curr_branch" ]; then - echo "You are not currently on a branch, so I cannot use any" - echo "'branch..merge' in your configuration file." - echo "Please specify which remote branch you want to use on the command" - echo "line and try again (e.g. 'git pull ')." - echo "See git-pull(1) for details." - elif [ -z "$upstream" ]; then - echo "You asked me to pull without telling me which branch you" - echo "want to $op_type $op_prep, and 'branch.${curr_branch}.merge' in" - echo "your configuration file does not tell me, either. Please" - echo "specify which branch you want to use on the command line and" - echo "try again (e.g. 'git pull ')." - echo "See git-pull(1) for details." - echo - echo "If you often $op_type $op_prep the same branch, you may want to" - echo "use something like the following in your configuration file:" - echo - echo " [branch \"${curr_branch}\"]" - echo " remote = " - echo " merge = " - test rebase = "$op_type" && - echo " rebase = true" - echo - echo " [remote \"\"]" - echo " url = " - echo " fetch = " - echo - echo "See git-config(1) for details." + elif [ -z "$curr_branch" -o -z "$upstream" ]; then + . git-parse-remote + error_on_missing_default_upstream "pull" $op_type $op_prep \ + "git pull " else echo "Your configuration specifies to $op_type $op_prep the ref '${upstream#refs/heads/}'" echo "from the remote, but no such ref was fetched."