We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 44c4cac commit bdc8d9aCopy full SHA for bdc8d9a
lib/thor/shell/basic.rb
@@ -380,8 +380,18 @@ def merge_tool #:nodoc:
380
@merge_tool ||= ENV["THOR_MERGE"] || git_merge_tool
381
end
382
383
- def git_merge_tool #:nodoc:
384
- `git config merge.tool`.rstrip rescue ""
+ def git_merge_tool
+ tool = `git config merge.tool`.strip
385
+ return "" if tool.empty?
386
+
387
+ custom = `git config --get mergetool.#{tool}.cmd`.strip
388
+ return custom unless custom.empty?
389
390
+ return tool if system("command -v #{Shellwords.escape(tool)} > /dev/null 2>&1")
391
392
+ "git mergetool --no-prompt --tool=#{tool}"
393
+ rescue
394
+ ""
395
396
397
0 commit comments