File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
gix-worktree/src/stack/state Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,17 @@ pub enum Source {
45
45
WorktreeThenIdMapping ,
46
46
}
47
47
48
+ impl Source {
49
+ /// Returns non-worktree variants of `self` if `is_bare` is true.
50
+ pub fn adjust_for_bare ( self , is_bare : bool ) -> Self {
51
+ if is_bare {
52
+ Source :: IdMapping
53
+ } else {
54
+ self
55
+ }
56
+ }
57
+ }
58
+
48
59
/// Initialization
49
60
impl Attributes {
50
61
/// Create a new instance from an attribute match group that represents `globals`. It can more easily be created with
Original file line number Diff line number Diff line change @@ -25,6 +25,17 @@ pub enum Source {
25
25
WorktreeThenIdMappingIfNotSkipped ,
26
26
}
27
27
28
+ impl Source {
29
+ /// Returns non-worktree variants of `self` if `is_bare` is true.
30
+ pub fn adjust_for_bare ( self , is_bare : bool ) -> Self {
31
+ if is_bare {
32
+ Source :: IdMapping
33
+ } else {
34
+ self
35
+ }
36
+ }
37
+ }
38
+
28
39
/// Various aggregate numbers related [`Ignore`].
29
40
#[ derive( Default , Clone , Copy , Debug ) ]
30
41
#[ cfg_attr( feature = "serde" , derive( serde:: Serialize , serde:: Deserialize ) ) ]
You can’t perform that action at this time.
0 commit comments