File tree Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Expand file tree Collapse file tree 3 files changed +55
-0
lines changed Original file line number Diff line number Diff line change @@ -126,6 +126,14 @@ impl NewOptions {
126
126
127
127
#[ derive( Deserialize ) ]
128
128
struct CargoNewConfig {
129
+ #[ deprecated = "cargo-new no longer supports adding the authors field" ]
130
+ #[ allow( dead_code) ]
131
+ name : Option < String > ,
132
+
133
+ #[ deprecated = "cargo-new no longer supports adding the authors field" ]
134
+ #[ allow( dead_code) ]
135
+ email : Option < String > ,
136
+
129
137
#[ serde( rename = "vcs" ) ]
130
138
version_control : Option < VersionControl > ,
131
139
}
Original file line number Diff line number Diff line change @@ -87,6 +87,30 @@ Caused by:
87
87
. run ( ) ;
88
88
}
89
89
90
+ #[ cargo_test]
91
+ fn bad4 ( ) {
92
+ let p = project ( )
93
+ . file (
94
+ ".cargo/config" ,
95
+ r#"
96
+ [cargo-new]
97
+ vcs = false
98
+ "# ,
99
+ )
100
+ . build ( ) ;
101
+ p. cargo ( "new -v foo" )
102
+ . with_status ( 101 )
103
+ . with_stderr (
104
+ "\
105
+ [ERROR] Failed to create package `foo` at `[..]`
106
+
107
+ Caused by:
108
+ error in [..]config: `cargo-new.vcs` expected a string, but found a boolean
109
+ " ,
110
+ )
111
+ . run ( ) ;
112
+ }
113
+
90
114
#[ cargo_test]
91
115
fn bad6 ( ) {
92
116
let p = project ( )
Original file line number Diff line number Diff line change @@ -245,6 +245,29 @@ fn displays_subcommand_on_error() {
245
245
. run ( ) ;
246
246
}
247
247
248
+ #[ cargo_test]
249
+ fn override_cargo_home ( ) {
250
+ let root = paths:: root ( ) ;
251
+ let my_home = root. join ( "my_home" ) ;
252
+ fs:: create_dir ( & my_home) . unwrap ( ) ;
253
+ fs:: write (
254
+ & my_home. join ( "config" ) ,
255
+ r#"
256
+ [cargo-new]
257
+ vcs = "none"
258
+ "# ,
259
+ )
260
+ . unwrap ( ) ;
261
+
262
+ cargo_process ( "new foo" ) . env ( "CARGO_HOME" , & my_home) . run ( ) ;
263
+
264
+ assert ! ( !paths:: root( ) . join( "foo/.git" ) . is_dir( ) ) ;
265
+
266
+ cargo_process ( "new foo2" ) . run ( ) ;
267
+
268
+ assert ! ( paths:: root( ) . join( "foo2/.git" ) . is_dir( ) ) ;
269
+ }
270
+
248
271
#[ cargo_test]
249
272
fn cargo_subcommand_env ( ) {
250
273
let src = format ! (
You can’t perform that action at this time.
0 commit comments