Use merge-recursive in git-checkout -m (branch switching)
[gitweb.git] / git-merge.sh
index 1c4f6693f5b6919da2a867a02465a382477cfcac..7b590268edb44cc5455fe9bdbcbfc0698a6fb800 100755 (executable)
@@ -5,11 +5,14 @@
 
 USAGE='[-n] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
 
+SUBDIRECTORY_OK=Yes
 . git-sh-setup
 set_reflog_action "merge $*"
+require_work_tree
+cd_to_toplevel
 
 test -z "$(git ls-files -u)" ||
-       die "You are in a middle of conflicted merge."
+       die "You are in the middle of a conflicted merge."
 
 LF='
 '