Skip to content

Commit

Permalink
difftool--helper: Make style consistent with git
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Aguilar authored and Junio C Hamano committed Aug 19, 2011
1 parent cee4268 commit fdd7aa1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions git-difftool--helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -48,16 +51,19 @@ 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
run_merge_tool "$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
Expand Down

0 comments on commit fdd7aa1

Please sign in to comment.