gitweb: Convert project name to UTF-8
[gitweb.git] / git-merge.sh
index 1c4f6693f5b6919da2a867a02465a382477cfcac..04a5eb0f297a691fa0520d1729ea20bd66a53bd9 100755 (executable)
@@ -5,11 +5,13 @@
 
 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='
 '
@@ -214,6 +216,7 @@ head=$(git-rev-parse --verify "$head_arg"^0) || usage
 
 # All the rest are remote heads
 test "$#" = 0 && usage ;# we need at least one remote head.
+set_reflog_action "merge $*"
 
 remoteheads=
 for remote
@@ -230,7 +233,7 @@ case "$use_strategies" in
 '')
        case "$#" in
        1)
-               var="`git-repo-config --get pull.twohead`"
+               var="`git-config --get pull.twohead`"
                if test -n "$var"
                then
                        use_strategies="$var"
@@ -238,7 +241,7 @@ case "$use_strategies" in
                        use_strategies="$default_twohead_strategies"
                fi ;;
        *)
-               var="`git-repo-config --get pull.octopus`"
+               var="`git-config --get pull.octopus`"
                if test -n "$var"
                then
                        use_strategies="$var"