go.fuchsia.dev/infra@v0.0.0-20240507153436-9b593402251b/cmd/submodule_update/gitutil/options.go (about) 1 // Copyright 2023 The Fuchsia Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 package gitutil 5 6 // CheckoutOpt is an interface for git checkout flags 7 type CheckoutOpt interface { 8 checkoutOpt() 9 } 10 11 // CloneOpt is an interface for git clone flags 12 type CloneOpt interface { 13 cloneOpt() 14 } 15 16 // DeleteBranchOpt is an interface for git branch deletion flags 17 type DeleteBranchOpt interface { 18 deleteBranchOpt() 19 } 20 21 // FetchOpt is an interface for git fetch flags 22 type FetchOpt interface { 23 fetchOpt() 24 } 25 26 // MergeOpt is an interface for git merge flags 27 type MergeOpt interface { 28 mergeOpt() 29 } 30 31 // PushOpt is an interface for git push flags 32 type PushOpt interface { 33 pushOpt() 34 } 35 36 // ResetOpt is an interface for git reset flags 37 type ResetOpt interface { 38 resetOpt() 39 } 40 41 // RebaseOpt is an interface for git rebase flags 42 type RebaseOpt interface { 43 rebaseOpt() 44 } 45 46 // SubmoduleUpdateOpt is an interface for git submodule update flags 47 type SubmoduleUpdateOpt interface { 48 submoduleUpdateOpt() 49 } 50 51 // SubmoduleStatusOpt is an interface for git submodule status flags 52 type SubmoduleStatusOpt interface { 53 submoduleStatusOpt() 54 } 55 56 // FollowTagsOpt is the 'follow-tags' git flag 57 type FollowTagsOpt bool 58 59 func (FollowTagsOpt) pushOpt() {} 60 61 // ForceOpt is the 'force' git flag 62 type ForceOpt bool 63 64 func (ForceOpt) checkoutOpt() {} 65 func (ForceOpt) deleteBranchOpt() {} 66 func (ForceOpt) pushOpt() {} 67 68 // DetachOpt is the 'detach' git flag 69 type DetachOpt bool 70 71 func (DetachOpt) checkoutOpt() {} 72 73 // ModeOpt is the mode argument for the 'mode' flag used by git reset 74 type ModeOpt string 75 76 func (ModeOpt) resetOpt() {} 77 78 // ResetOnFailureOpt flag enables a git reset of the merge if git merge errors 79 type ResetOnFailureOpt bool 80 81 func (ResetOnFailureOpt) mergeOpt() {} 82 83 // SquashOpt is the 'squash' git flag 84 type SquashOpt bool 85 86 func (SquashOpt) mergeOpt() {} 87 88 // StrategyOpt is the strategy argument for the 'strategy' flag used by git merge 89 type StrategyOpt string 90 91 func (StrategyOpt) mergeOpt() {} 92 93 // FfOnlyOpt is the 'ff-only' git flag 94 type FfOnlyOpt bool 95 96 func (FfOnlyOpt) mergeOpt() {} 97 98 // TagsOpt is the 'tags' git flag 99 type TagsOpt bool 100 101 func (TagsOpt) fetchOpt() {} 102 103 // FetchTagOpt is the tag argument for the 'tag' flag used by git fetch 104 type FetchTagOpt string 105 106 func (FetchTagOpt) fetchOpt() {} 107 108 // AllOpt is the 'all' git flag 109 type AllOpt bool 110 111 func (AllOpt) fetchOpt() {} 112 113 // PruneOpt is the 'prune' git flag 114 type PruneOpt bool 115 116 func (PruneOpt) fetchOpt() {} 117 118 // DepthOpt is the numeric argument for the 'depth' flag used by git 119 type DepthOpt int 120 121 func (DepthOpt) fetchOpt() {} 122 123 // UpdateShallowOpt is the 'update-shallow' git flag 124 type UpdateShallowOpt bool 125 126 func (UpdateShallowOpt) fetchOpt() {} 127 128 // VerifyOpt is the 'verify' git flag 129 type VerifyOpt bool 130 131 func (VerifyOpt) pushOpt() {} 132 133 // SharedOpt is the 'shared' git flag 134 type SharedOpt bool 135 136 func (SharedOpt) cloneOpt() {} 137 138 // ReferenceOpt is the reference argument for the git 'reference-if-able' flag used by git clone 139 type ReferenceOpt string 140 141 func (ReferenceOpt) cloneOpt() {} 142 143 // NoCheckoutOpt is the 'no-checkout' git flag 144 type NoCheckoutOpt bool 145 146 func (NoCheckoutOpt) cloneOpt() {} 147 148 func (DepthOpt) cloneOpt() {} 149 150 // BareOpt is the 'bare' git flag 151 type BareOpt bool 152 153 func (BareOpt) cloneOpt() {} 154 155 // OmitBlobsOpt is the 'filter=blob:none' (no binary blobs) git flag 156 type OmitBlobsOpt bool 157 158 func (OmitBlobsOpt) cloneOpt() {} 159 160 // RebaseMerges is the 'rebase-merges' git flag 161 type RebaseMerges bool 162 163 func (RebaseMerges) rebaseOpt() {} 164 165 // UpdateHeadOkOpt is the 'update-head-ok' git flag 166 type UpdateHeadOkOpt bool 167 168 func (UpdateHeadOkOpt) fetchOpt() {} 169 170 // OffloadPackfilesOpt is a flag used with git clone to fetch using https protocol 171 type OffloadPackfilesOpt bool 172 173 func (OffloadPackfilesOpt) cloneOpt() {} 174 175 // RecurseSubmodulesOpt is the 'recurse-submodules' git flag 176 type RecurseSubmodulesOpt bool 177 178 func (RecurseSubmodulesOpt) cloneOpt() {} 179 func (RecurseSubmodulesOpt) fetchOpt() {} 180 181 // InitOpt is the 'init' git flag 182 type InitOpt bool 183 184 func (InitOpt) submoduleUpdateOpt() {} 185 186 // JobsOpt is the numeric argument for the 'jobs' flag used by git 187 type JobsOpt uint 188 189 func (JobsOpt) fetchOpt() {} 190 191 // CachedOpt is the 'cached' git flag 192 type CachedOpt bool 193 194 func (CachedOpt) submoduleStatusOpt() {}