@matheusbsbs / matheus-bagliano / commits / 51901e96bf
Fork 0

git-merge: tighten error checking.

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>

Junio C Hamano committed Nov 26, 2006 at 22:16 UTC 51901e96bf592877f7b266d0d9c6cb83b363edce
1 file changed +3 -3
git-merge.sh
+3 -3
@@ -188,13 +188,13 @@ else
188 # in this loop.
189 merge_name=$(for remote
190 do
191 - rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null)
191 + rh=$(git-rev-parse --verify "$remote"^0 2>/dev/null) &&
192 if git show-ref -q --verify "refs/heads/$remote"
193 then
194 what=branch
195 else
196 what=commit
197 - fi
197 + fi &&
198 echo "$rh $what '$remote'"
199 done | git-fmt-merge-msg
200 )
@@ -209,7 +209,7 @@ test "$rloga" = '' && rloga="merge: $@"
209 remoteheads=
210 for remote
211 do
212 - remotehead=$(git-rev-parse --verify "$remote"^0) ||
212 + remotehead=$(git-rev-parse --verify "$remote"^0 2>/dev/null) ||
213 die "$remote - not something we can merge"
214 remoteheads="${remoteheads}$remotehead "
215 done