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>
This commit is contained in:
parent
d4ebc36c5e
commit
4363dfbe3d
@ -132,7 +132,6 @@ canon_refs_list_for_fetch () {
|
|||||||
# or the first one otherwise; add prefix . to the rest
|
# or the first one otherwise; add prefix . to the rest
|
||||||
# to prevent the secondary branches to be merged by default.
|
# to prevent the secondary branches to be merged by default.
|
||||||
merge_branches=
|
merge_branches=
|
||||||
found_mergeref=
|
|
||||||
curr_branch=
|
curr_branch=
|
||||||
if test "$1" = "-d"
|
if test "$1" = "-d"
|
||||||
then
|
then
|
||||||
@ -172,10 +171,6 @@ canon_refs_list_for_fetch () {
|
|||||||
dot_prefix= && break
|
dot_prefix= && break
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if test -z $dot_prefix
|
|
||||||
then
|
|
||||||
found_mergeref=true
|
|
||||||
fi
|
|
||||||
case "$remote" in
|
case "$remote" in
|
||||||
'') remote=HEAD ;;
|
'') remote=HEAD ;;
|
||||||
refs/heads/* | refs/tags/* | refs/remotes/*) ;;
|
refs/heads/* | refs/tags/* | refs/remotes/*) ;;
|
||||||
@ -196,11 +191,6 @@ canon_refs_list_for_fetch () {
|
|||||||
fi
|
fi
|
||||||
echo "${dot_prefix}${force}${remote}:${local}"
|
echo "${dot_prefix}${force}${remote}:${local}"
|
||||||
done
|
done
|
||||||
if test -z "$found_mergeref" -a "$curr_branch"
|
|
||||||
then
|
|
||||||
echo >&2 "Warning: No merge candidate found because value of config option
|
|
||||||
\"branch.${curr_branch}.merge\" does not match any remote branch fetched."
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Returns list of src: (no store), or src:dst (store)
|
# Returns list of src: (no store), or src:dst (store)
|
||||||
|
@ -76,6 +76,10 @@ merge_head=$(sed -e '/ not-for-merge /d' \
|
|||||||
|
|
||||||
case "$merge_head" in
|
case "$merge_head" in
|
||||||
'')
|
'')
|
||||||
|
curr_branch=$(git-symbolic-ref HEAD | \
|
||||||
|
sed -e 's|^refs/heads/||')
|
||||||
|
echo >&2 "Warning: No merge candidate found because value of config option
|
||||||
|
\"branch.${curr_branch}.merge\" does not match any remote branch fetched."
|
||||||
echo >&2 "No changes."
|
echo >&2 "No changes."
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
Loading…
Reference in New Issue
Block a user