File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,8 @@ git_enum! {
200
200
GIT_EOWNER = -36 ,
201
201
GIT_TIMEOUT = -37 ,
202
202
GIT_EUNCHANGED = -38 ,
203
+ GIT_ENOTSUPPORTED = -39 ,
204
+ GIT_EREADONLY = -40 ,
203
205
}
204
206
}
205
207
@@ -878,7 +880,8 @@ git_enum! {
878
880
GIT_CONFIG_LEVEL_XDG = 3 ,
879
881
GIT_CONFIG_LEVEL_GLOBAL = 4 ,
880
882
GIT_CONFIG_LEVEL_LOCAL = 5 ,
881
- GIT_CONFIG_LEVEL_APP = 6 ,
883
+ GIT_CONFIG_LEVEL_WORKTREE = 6 ,
884
+ GIT_CONFIG_LEVEL_APP = 7 ,
882
885
GIT_CONFIG_HIGHEST_LEVEL = -1 ,
883
886
}
884
887
}
@@ -1974,6 +1977,7 @@ git_enum! {
1974
1977
pub struct git_worktree_add_options {
1975
1978
pub version : c_uint ,
1976
1979
pub lock : c_int ,
1980
+ pub checkout_existing : c_int ,
1977
1981
pub reference : * mut git_reference ,
1978
1982
pub checkout_options : git_checkout_options ,
1979
1983
}
Original file line number Diff line number Diff line change @@ -165,6 +165,12 @@ impl<'a> WorktreeAddOptions<'a> {
165
165
self
166
166
}
167
167
168
+ /// If enabled, this will checkout the existing branch matching the worktree name.
169
+ pub fn checkout_existing ( & mut self , enabled : bool ) -> & mut WorktreeAddOptions < ' a > {
170
+ self . raw . checkout_existing = enabled as c_int ;
171
+ self
172
+ }
173
+
168
174
/// reference to use for the new worktree HEAD
169
175
pub fn reference (
170
176
& mut self ,
Original file line number Diff line number Diff line change @@ -25,7 +25,9 @@ fn main() {
25
25
// this field is marked as const which ctest complains about
26
26
( struct_ == "git_rebase_operation" && f == "id" ) ||
27
27
// the real name of this field is ref but that is a reserved keyword
28
- ( struct_ == "git_worktree_add_options" && f == "reference" )
28
+ ( struct_ == "git_worktree_add_options" && f == "reference" ) ||
29
+ // the `update_flags` field consists of 2 bitfields
30
+ ( struct_ == "git_fetch_options" && f == "update_flags" )
29
31
} ) ;
30
32
cfg. skip_signededness ( |s| match s {
31
33
s if s. ends_with ( "_cb" ) => true ,
You can’t perform that action at this time.
0 commit comments