Skip to content

Commit

Permalink
git-merge: tighten error checking.
Browse files Browse the repository at this point in the history
If a branch name to be merged is misspelled, the command leaked error
messages from underlying plumbing commands, which were helpful only
to people who know how the command are implemented to diagnose the
breakage, but simply puzzling and unhelpful for the end users.

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Nov 27, 2006
1 parent 8092c7f commit 51901e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,13 @@ else
# in this loop.
merge_name=$(for remote
do
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null)
rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) &&
if git show-ref -q --verify "refs/heads/$remote"
then
what=branch
else
what=commit
fi
fi &&
echo "$rh $what '$remote'"
done | git-fmt-merge-msg
)
Expand All @@ -209,7 +209,7 @@ test "$rloga" = '' && rloga="merge: $@"
remoteheads=
for remote
do
remotehead=$(git-rev-parse --verify "$remote"^0) ||
remotehead=$(git-rev-parse --verify "$remote"^0 2>/dev/null) ||
die "$remote - not something we can merge"
remoteheads="${remoteheads}$remotehead "
done
Expand Down

0 comments on commit 51901e9

Please sign in to comment.