Allow whole-tree operations to be started from a subdirectory
[gitweb.git] / git-merge.sh
index 477002910ede7f6bc6bcb9a79f6ddebd248f6bd2..7de83dc76c442e2187c66d32bc704a063ab83781 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='
 '