-
Notifications
You must be signed in to change notification settings - Fork 199
/
raw_meta_git_worktree.go
39 lines (31 loc) · 1.04 KB
/
raw_meta_git_worktree.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package config
type rawMetaGitWorktree struct {
ForceShallowClone *bool `yaml:"forceShallowClone,omitempty"`
AllowUnshallow *bool `yaml:"allowUnshallow,omitempty"`
AllowFetchingOriginBranchesAndTags *bool `yaml:"allowFetchOriginBranchesAndTags,omitempty"`
rawMeta *rawMeta
UnsupportedAttributes map[string]interface{} `yaml:",inline"`
}
func (c *rawMetaGitWorktree) UnmarshalYAML(unmarshal func(interface{}) error) error {
if parent, ok := parentStack.Peek().(*rawMeta); ok {
c.rawMeta = parent
}
parentStack.Push(c)
type plain rawMetaGitWorktree
err := unmarshal((*plain)(c))
parentStack.Pop()
if err != nil {
return err
}
if err := checkOverflow(c.UnsupportedAttributes, nil, c.rawMeta.doc); err != nil {
return err
}
return nil
}
func (c *rawMetaGitWorktree) toMetaGitWorktree() MetaGitWorktree {
obj := MetaGitWorktree{}
obj.ForceShallowClone = c.ForceShallowClone
obj.AllowUnshallow = c.AllowUnshallow
obj.AllowFetchingOriginBranchesAndTags = c.AllowFetchingOriginBranchesAndTags
return obj
}