Allow whole-tree operations to be started from a subdirectory
[gitweb.git] / git-merge.sh
index 3eef048efc7a848145697e205d154c92f8c7ec0f..7de83dc76c442e2187c66d32bc704a063ab83781 100755 (executable)
@@ -5,12 +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='
 '