Skip to content

Commit

Permalink
Move "no merge candidate" warning into git-pull
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josef Weidendorfer authored and Junio C Hamano committed Dec 19, 2006
1 parent d4ebc36 commit 4363dfb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 0 additions & 10 deletions git-parse-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ canon_refs_list_for_fetch () {
# or the first one otherwise; add prefix . to the rest
# to prevent the secondary branches to be merged by default.
merge_branches=
found_mergeref=
curr_branch=
if test "$1" = "-d"
then
Expand Down Expand Up @@ -172,10 +171,6 @@ canon_refs_list_for_fetch () {
dot_prefix= && break
done
fi
if test -z $dot_prefix
then
found_mergeref=true
fi
case "$remote" in
'') remote=HEAD ;;
refs/heads/* | refs/tags/* | refs/remotes/*) ;;
Expand All @@ -196,11 +191,6 @@ canon_refs_list_for_fetch () {
fi
echo "${dot_prefix}${force}${remote}:${local}"
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)
Expand Down
4 changes: 4 additions & 0 deletions git-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ merge_head=$(sed -e '/ not-for-merge /d' \

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."
exit 0
;;
Expand Down

0 comments on commit 4363dfb

Please sign in to comment.