path: root/
diff options
authorJunio C Hamano <>2009-09-13 20:38:48 (GMT)
committerJunio C Hamano <>2009-09-23 05:26:27 (GMT)
commita6dbf8814f433a7fbfa9cde6333c98019f6db1e4 (patch)
tree2574d638b867d669fbeeab5912335fee8d54ee1e /
parent3ddcb1981ba24a45c555152ecbd32b945c32a211 (diff)
pull: Clarify "helpful" message for another corner casev1.6.5-rc2
When the remote branch we asked for merging did not exist in the set of fetched refs, we unconditionally hinted that it was because of lack of configuration. It is not necessarily so, and risks sending users for a wild goose chase. Make sure to check if that is indeed the case before telling a wild guess to the user. Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 6 insertions, 1 deletions
diff --git a/ b/
index 0bbd5bf..edf3ce3 100755
--- a/
+++ b/
@@ -89,6 +89,7 @@ error_on_no_merge_candidates () {
+ upstream=$(git config "branch.$curr_branch.merge")
if [ -z "$curr_branch" ]; then
echo "You are not currently on a branch, so I cannot use any"
@@ -96,7 +97,7 @@ error_on_no_merge_candidates () {
echo "Please specify which branch you want to merge on the command"
echo "line and try again (e.g. 'git pull <repository> <refspec>')."
echo "See git-pull(1) for details."
- else
+ elif [ -z "$upstream" ]; then
echo "You asked me to pull without telling me which branch you"
echo "want to merge with, and 'branch.${curr_branch}.merge' in"
echo "your configuration file does not tell me either. Please"
@@ -114,6 +115,10 @@ error_on_no_merge_candidates () {
echo " remote.<nickname>.fetch = <refspec>"
echo "See git-config(1) for details."
+ else
+ echo "Your configuration specifies to merge the ref"
+ echo "'${upstream#refs/heads/}' from the remote, but no such ref"
+ echo "was fetched."
exit 1