File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -3621,4 +3621,25 @@ mod tests {
3621
3621
// reverting twice restores `foo` file
3622
3622
assert ! ( foo_file. exists( ) ) ;
3623
3623
}
3624
+
3625
+ #[ test]
3626
+ fn smoke_config_write_and_read ( ) {
3627
+ let td = TempDir :: new ( ) . unwrap ( ) ;
3628
+ let path = td. path ( ) ;
3629
+
3630
+ let repo = Repository :: init ( path) . unwrap ( ) ;
3631
+
3632
+ let mut config = repo. config ( ) . unwrap ( ) ;
3633
+
3634
+ config. set_bool ( "commit.gpgsign" , false ) . unwrap ( ) ;
3635
+
3636
+ let c = fs:: read_to_string ( path. join ( ".git" ) . join ( "config" ) ) . unwrap ( ) ;
3637
+
3638
+ assert ! ( c. contains( "[commit]" ) ) ;
3639
+ assert ! ( c. contains( "gpgsign = false" ) ) ;
3640
+
3641
+ let config = repo. config ( ) . unwrap ( ) ;
3642
+
3643
+ assert ! ( !config. get_bool( "commit.gpgsign" ) . unwrap( ) ) ;
3644
+ }
3624
3645
}
You can’t perform that action at this time.
0 commit comments