git-am --resolved: more usable error message.
After doing the hard work of hand resolving the conflicts in the working tree, if the user forgets to run update-index to mark the paths that have been resolved, the command gave an unfriendly "fatal: git-write-tree: not able to write tree" error message. Catch the situation early and give more meaningful message and suggestion. Noticed and suggested by Len Brown. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Apr 28, 2006 at 02:32 UTC
c1d1128bef97ae16a6740538abe5fb81c67ed239
1 file changed
+7
git-am.sh
+7
@@ -376,6 +376,13 @@ do
376
echo "No changes - did you forget update-index?"
377
stop_here $this
378
fi
379
+ unmerged=$(git-ls-files -u)
380
+ if test -n "$unmerged"
381
+ then
382
+ echo "You still have unmerged paths in your index"
383
+ echo "did you forget update-index?"
384
+ stop_here $this
385
+ fi
386
apply_status=0
387
;;
388
esac