Fossil SCM
On diff/gdiff command, override "diff-binary" setting when argument "--diff-binary off" command line option is specified, not only with "--diff-binary on".
Commit
f62c2470834c421d5f29714c6879ea67c56c9d0b
Parent
8b562b90c05a0c3…
1 file changed
+7
-6
+7
-6
| --- src/diffcmd.c | ||
| +++ src/diffcmd.c | ||
| @@ -749,17 +749,18 @@ | ||
| 749 | 749 | /* |
| 750 | 750 | ** Returns non-zero if files that may be binary should be used with external |
| 751 | 751 | ** diff programs. |
| 752 | 752 | */ |
| 753 | 753 | int diff_include_binary_files(void){ |
| 754 | - if( is_truth(find_option("diff-binary", 0, 1)) ){ | |
| 755 | - return 1; | |
| 754 | + const char* zArgIncludeBinary = find_option("diff-binary", 0, 1); | |
| 755 | + | |
| 756 | + /* Command line argument have priority on settings */ | |
| 757 | + if( zArgIncludeBinary ){ | |
| 758 | + return is_truth(zArgIncludeBinary); | |
| 759 | + }else{ | |
| 760 | + return db_get_boolean("diff-binary", 1); | |
| 756 | 761 | } |
| 757 | - if( db_get_boolean("diff-binary", 1) ){ | |
| 758 | - return 1; | |
| 759 | - } | |
| 760 | - return 0; | |
| 761 | 762 | } |
| 762 | 763 | |
| 763 | 764 | /* |
| 764 | 765 | ** Returns the GLOB pattern for file names that should be treated as binary |
| 765 | 766 | ** by the diff subsystem, if any. |
| 766 | 767 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -749,17 +749,18 @@ | |
| 749 | /* |
| 750 | ** Returns non-zero if files that may be binary should be used with external |
| 751 | ** diff programs. |
| 752 | */ |
| 753 | int diff_include_binary_files(void){ |
| 754 | if( is_truth(find_option("diff-binary", 0, 1)) ){ |
| 755 | return 1; |
| 756 | } |
| 757 | if( db_get_boolean("diff-binary", 1) ){ |
| 758 | return 1; |
| 759 | } |
| 760 | return 0; |
| 761 | } |
| 762 | |
| 763 | /* |
| 764 | ** Returns the GLOB pattern for file names that should be treated as binary |
| 765 | ** by the diff subsystem, if any. |
| 766 |
| --- src/diffcmd.c | |
| +++ src/diffcmd.c | |
| @@ -749,17 +749,18 @@ | |
| 749 | /* |
| 750 | ** Returns non-zero if files that may be binary should be used with external |
| 751 | ** diff programs. |
| 752 | */ |
| 753 | int diff_include_binary_files(void){ |
| 754 | const char* zArgIncludeBinary = find_option("diff-binary", 0, 1); |
| 755 | |
| 756 | /* Command line argument have priority on settings */ |
| 757 | if( zArgIncludeBinary ){ |
| 758 | return is_truth(zArgIncludeBinary); |
| 759 | }else{ |
| 760 | return db_get_boolean("diff-binary", 1); |
| 761 | } |
| 762 | } |
| 763 | |
| 764 | /* |
| 765 | ** Returns the GLOB pattern for file names that should be treated as binary |
| 766 | ** by the diff subsystem, if any. |
| 767 |