summaryrefslogtreecommitdiff
path: root/git-difftool--helper.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2011-08-18 07:23:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-19 07:09:17 (GMT)
commitfdd7aa17f805b376f49a1bf031bf1b88eec89ddf (patch)
treeb1f9d46028e83ebf630a40e55da29c0979c41d74 /git-difftool--helper.sh
parentcee426811c981c62c4b236ebdcb47d1c2945cf56 (diff)
downloadgit-fdd7aa17f805b376f49a1bf031bf1b88eec89ddf.zip
git-fdd7aa17f805b376f49a1bf031bf1b88eec89ddf.tar.gz
git-fdd7aa17f805b376f49a1bf031bf1b88eec89ddf.tar.bz2
difftool--helper: Make style consistent with git
Use the predominant conditional style where "then" appears alone on the line after the test expression. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-difftool--helper.sh')
-rwxr-xr-xgit-difftool--helper.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 0594bf7..8452890 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -13,7 +13,8 @@ TOOL_MODE=diff
should_prompt () {
prompt_merge=$(git config --bool mergetool.prompt || echo true)
prompt=$(git config --bool difftool.prompt || echo $prompt_merge)
- if test "$prompt" = true; then
+ if test "$prompt" = true
+ then
test -z "$GIT_DIFFTOOL_NO_PROMPT"
else
test -n "$GIT_DIFFTOOL_PROMPT"
@@ -37,9 +38,11 @@ launch_merge_tool () {
# $LOCAL and $REMOTE are temporary files so prompt
# the user with the real $MERGED name before launching $merge_tool.
- if should_prompt; then
+ if should_prompt
+ then
printf "\nViewing: '$MERGED'\n"
- if use_ext_cmd; then
+ if use_ext_cmd
+ then
printf "Hit return to launch '%s': " \
"$GIT_DIFFTOOL_EXTCMD"
else
@@ -48,7 +51,8 @@ launch_merge_tool () {
read ans
fi
- if use_ext_cmd; then
+ if use_ext_cmd
+ then
export BASE
eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'
else
@@ -56,8 +60,10 @@ launch_merge_tool () {
fi
}
-if ! use_ext_cmd; then
- if test -n "$GIT_DIFF_TOOL"; then
+if ! use_ext_cmd
+then
+ if test -n "$GIT_DIFF_TOOL"
+ then
merge_tool="$GIT_DIFF_TOOL"
else
merge_tool="$(get_merge_tool)" || exit