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".

mgagnon 2017-02-03 15:13 trunk
Commit f62c2470834c421d5f29714c6879ea67c56c9d0b
1 file changed +7 -6
+7 -6
--- src/diffcmd.c
+++ src/diffcmd.c
@@ -749,17 +749,18 @@
749749
/*
750750
** Returns non-zero if files that may be binary should be used with external
751751
** diff programs.
752752
*/
753753
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);
756761
}
757
- if( db_get_boolean("diff-binary", 1) ){
758
- return 1;
759
- }
760
- return 0;
761762
}
762763
763764
/*
764765
** Returns the GLOB pattern for file names that should be treated as binary
765766
** by the diff subsystem, if any.
766767
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button