@matheusbsbs / matheus-bagliano / commits / 4363dfbe3d
Fork 0

Move "no merge candidate" warning into git-pull

The warning triggered even when running "git fetch" only when resulting .git/FETCH_HEAD only contained branches marked as 'not-for-merge'. Signed-off-by: Josef Weidendorfer <weidendo@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Josef Weidendorfer committed Dec 19, 2006 at 01:39 UTC 4363dfbe3d2f3fe3a4bd0fa7e9b22a14532c6cdb
2 files changed +4 -10
git-parse-remote.sh
-10
@@ -132,7 +132,6 @@ canon_refs_list_for_fetch () {
132 # or the first one otherwise; add prefix . to the rest
133 # to prevent the secondary branches to be merged by default.
134 merge_branches=
135 - found_mergeref=
135 curr_branch=
136 if test "$1" = "-d"
137 then
@@ -172,10 +171,6 @@ canon_refs_list_for_fetch () {
171 dot_prefix= && break
172 done
173 fi
175 - if test -z $dot_prefix
176 - then
177 - found_mergeref=true
178 - fi
174 case "$remote" in
175 '') remote=HEAD ;;
176 refs/heads/* | refs/tags/* | refs/remotes/*) ;;
@@ -196,11 +191,6 @@ canon_refs_list_for_fetch () {
191 fi
192 echo "${dot_prefix}${force}${remote}:${local}"
193 done
199 - if test -z "$found_mergeref" -a "$curr_branch"
200 - then
201 - echo >&2 "Warning: No merge candidate found because value of config option
202 - \"branch.${curr_branch}.merge\" does not match any remote branch fetched."
203 - fi
194 }
195
196 # Returns list of src: (no store), or src:dst (store)
git-pull.sh
+4
@@ -76,6 +76,10 @@ merge_head=$(sed -e '/ not-for-merge /d' \
76
77 case "$merge_head" in
78 '')
79 + curr_branch=$(git-symbolic-ref HEAD | \
80 + sed -e 's|^refs/heads/||')
81 + echo >&2 "Warning: No merge candidate found because value of config option
82 + \"branch.${curr_branch}.merge\" does not match any remote branch fetched."
83 echo >&2 "No changes."
84 exit 0
85 ;;