summaryrefslogtreecommitdiff
path: root/git-mergetool.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-10-21 13:28:37 -0700
committerJunio C Hamano <gitster@pobox.com>2014-10-21 13:28:37 -0700
commite96e98b3399ae4c638466f84068fe94d4712c5a3 (patch)
tree55cee4b82db5239c5f1b2070509c261b378f55f3 /git-mergetool.sh
parent02f4db83bd979fe33f18006fa612d7d5ab1d2470 (diff)
parent4fb4b02d98310f4f859f7d52f57f36d49198be5c (diff)
downloadgit-e96e98b3399ae4c638466f84068fe94d4712c5a3.tar.gz
Merge branch 'da/mergetool-tool-help'
Allow "git mergetool --help" to run outside a Git repository. * da/mergetool-tool-help: difftool: don't assume that default sh is sane mergetool: don't require a work tree for --tool-help git-sh-setup: move GIT_DIR initialization into a function mergetool: use more conservative temporary filenames test-lib-functions: adjust style to match CodingGuidelines t7610-mergetool: prefer test_config over git config
Diffstat (limited to 'git-mergetool.sh')
-rwxr-xr-xgit-mergetool.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/git-mergetool.sh b/git-mergetool.sh
index 96a61ba6f4..ec644d542d 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -10,11 +10,11 @@
USAGE='[--tool=tool] [--tool-help] [-y|--no-prompt|--prompt] [file to merge] ...'
SUBDIRECTORY_OK=Yes
+NONGIT_OK=Yes
OPTIONS_SPEC=
TOOL_MODE=merge
. git-sh-setup
. git-mergetool--lib
-require_work_tree
# Returns true if the mode reflects a symlink
is_symlink () {
@@ -327,6 +327,10 @@ guessed_merge_tool=false
while test $# != 0
do
case "$1" in
+ --tool-help=*)
+ TOOL_MODE=${1#--tool-help=}
+ show_tool_help
+ ;;
--tool-help)
show_tool_help
;;
@@ -378,6 +382,9 @@ prompt_after_failed_merge () {
done
}
+git_dir_init
+require_work_tree
+
if test -z "$merge_tool"
then
# Check if a merge tool has been configured