Class: Git::RemoteInfo
- Inherits:
-
Data
- Object
- Data
- Git::RemoteInfo
- Defined in:
- lib/git/remote_info.rb
Overview
Value object representing a configured git remote
Each instance holds the parsed configuration for a single remote as read
from the repository's git config. Multi-value fields (:url, :push_url,
:fetch, :push) are always Array<String> (never nil; may be empty).
Those arrays are frozen copies of the values given, so the set of URLs and
refspecs cannot change after construction; use with to derive a modified
copy. The immutability is shallow, as with any Data member: the strings
inside those arrays and the scalar members are the objects the caller
passed in, not copies. All other fields are nilable except :name.
Instance Attribute Summary collapse
-
#fetch ⇒ Array<String>
readonly
The fetch refspec(s) for this remote (
remote.<name>.fetch). -
#mirror ⇒ Boolean?
readonly
true/falseperremote.<name>.mirror, ornilwhen not set. -
#name ⇒ String
readonly
The name of the remote (e.g.
'origin'). -
#partial_clone_filter ⇒ String?
readonly
The partial-clone object filter (
remote.<name>.partialclonefilter). -
#promisor ⇒ Boolean?
readonly
true/falseperremote.<name>.promisor, ornilwhen not set. -
#prune ⇒ Boolean?
readonly
true/falseperremote.<name>.prune;nilinheritsfetch.prune. -
#prune_tags ⇒ Boolean?
readonly
true/falseperremote.<name>.pruneTags;nilinheritsfetch.pruneTags. -
#push ⇒ Array<String>
readonly
The push refspec(s) for this remote (
remote.<name>.push). -
#push_url ⇒ Array<String>
readonly
The push URL(s) for this remote (
remote.<name>.pushurl). -
#receivepack ⇒ String?
readonly
The
git-receive-packpath on the remote (remote.<name>.receivepack). -
#skip_default_update ⇒ Boolean?
readonly
true/falseperremote.<name>.skipDefaultUpdate, ornilwhen not set. -
#tag_opt ⇒ String?
readonly
The tag-fetching option (
remote.<name>.tagOpt), ornilwhen not set. -
#uploadpack ⇒ String?
readonly
The
git-upload-packpath on the remote (remote.<name>.uploadpack). -
#url ⇒ Array<String>
readonly
The fetch URL(s) for this remote (
remote.<name>.url). -
#vcs ⇒ String?
readonly
The VCS type for git-remote helpers (
remote.<name>.vcs).
Instance Method Summary collapse
-
#initialize(name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil) ⇒ Git::RemoteInfo
constructor
Create a new RemoteInfo.
-
#with(**fields) ⇒ Git::RemoteInfo
Return a copy of this RemoteInfo with the given fields replaced.
Constructor Details
#initialize(name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil) ⇒ Git::RemoteInfo
Create a new RemoteInfo
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/git/remote_info.rb', line 125 def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end |
Instance Attribute Details
#fetch ⇒ Array<String> (readonly)
Returns the fetch refspec(s) for this remote (remote.<name>.fetch).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#mirror ⇒ Boolean? (readonly)
Returns true/false per remote.<name>.mirror, or nil when not set.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#name ⇒ String (readonly)
Returns the name of the remote (e.g. 'origin').
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#partial_clone_filter ⇒ String? (readonly)
Returns the partial-clone object filter (remote.<name>.partialclonefilter).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#promisor ⇒ Boolean? (readonly)
Returns true/false per remote.<name>.promisor, or nil when not set.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#prune ⇒ Boolean? (readonly)
Returns true/false per remote.<name>.prune; nil inherits fetch.prune.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#prune_tags ⇒ Boolean? (readonly)
Returns true/false per remote.<name>.pruneTags; nil inherits fetch.pruneTags.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#push ⇒ Array<String> (readonly)
Returns the push refspec(s) for this remote (remote.<name>.push).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#push_url ⇒ Array<String> (readonly)
Returns the push URL(s) for this remote (remote.<name>.pushurl).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#receivepack ⇒ String? (readonly)
Returns the git-receive-pack path on the remote (remote.<name>.receivepack).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#skip_default_update ⇒ Boolean? (readonly)
Returns true/false per remote.<name>.skipDefaultUpdate, or nil when not set.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#tag_opt ⇒ String? (readonly)
Returns the tag-fetching option (remote.<name>.tagOpt), or nil when not set.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#uploadpack ⇒ String? (readonly)
Returns the git-upload-pack path on the remote (remote.<name>.uploadpack).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#url ⇒ Array<String> (readonly)
Returns the fetch URL(s) for this remote (remote.<name>.url).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
#vcs ⇒ String? (readonly)
Returns the VCS type for git-remote helpers (remote.<name>.vcs).
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/git/remote_info.rb', line 74 RemoteInfo = Data.define( :name, :url, :push_url, :fetch, :push, :mirror, :skip_default_update, :tag_opt, :prune, :prune_tags, :receivepack, :uploadpack, :promisor, :partial_clone_filter, :vcs ) do # Create a new RemoteInfo # # @param name [String] the name of the remote (required) # # @param url [Array<String>] fetch URLs (default `[]`); stored as a frozen copy # # @param push_url [Array<String>] push URLs (default `[]`); stored as a frozen copy # # @param fetch [Array<String>] fetch refspecs (default `[]`); stored as a frozen copy # # @param push [Array<String>] push refspecs (default `[]`); stored as a frozen copy # # @param mirror [Boolean, nil] mirror flag (default `nil`) # # @param skip_default_update [Boolean, nil] skip-default-update flag (default `nil`) # # @param tag_opt [String, nil] tag-fetching option (default `nil`) # # @param prune [Boolean, nil] prune flag (default `nil`) # # @param prune_tags [Boolean, nil] prune-tags flag (default `nil`) # # @param receivepack [String, nil] receive-pack path (default `nil`) # # @param uploadpack [String, nil] upload-pack path (default `nil`) # # @param promisor [Boolean, nil] promisor flag (default `nil`) # # @param partial_clone_filter [String, nil] partial-clone filter (default `nil`) # # @param vcs [String, nil] VCS type (default `nil`) # # @return [Git::RemoteInfo] # def initialize( # rubocop:disable Metrics/ParameterLists name:, url: [], push_url: [], fetch: [], push: [], mirror: nil, skip_default_update: nil, tag_opt: nil, prune: nil, prune_tags: nil, receivepack: nil, uploadpack: nil, promisor: nil, partial_clone_filter: nil, vcs: nil ) super( name:, url: Array(url).dup.freeze, push_url: Array(push_url).dup.freeze, fetch: Array(fetch).dup.freeze, push: Array(push).dup.freeze, mirror:, skip_default_update:, tag_opt:, prune:, prune_tags:, receivepack:, uploadpack:, promisor:, partial_clone_filter:, vcs: ) end # Return a copy of this RemoteInfo with the given fields replaced # # Routes through {#initialize} so the multi-value fields of the copy are # frozen copies, the same as on construction. `Data#with` bypasses # `initialize` on Ruby 3.2, which would leave those arrays mutable. # # @example Replace the fetch URL # info.with(url: ['https://example.com/other.git']).url # # => ["https://example.com/other.git"] # # @param fields [Hash{Symbol => Object}] the fields to replace, keyed by # member name # # @option fields [String] :name the name of the remote # # @option fields [Array<String>] :url fetch URLs # # @option fields [Array<String>] :push_url push URLs # # @option fields [Array<String>] :fetch fetch refspecs # # @option fields [Array<String>] :push push refspecs # # @option fields [Boolean, nil] :mirror mirror flag # # @option fields [Boolean, nil] :skip_default_update skip-default-update flag # # @option fields [String, nil] :tag_opt tag-fetching option # # @option fields [Boolean, nil] :prune prune flag # # @option fields [Boolean, nil] :prune_tags prune-tags flag # # @option fields [String, nil] :receivepack receive-pack path # # @option fields [String, nil] :uploadpack upload-pack path # # @option fields [Boolean, nil] :promisor promisor flag # # @option fields [String, nil] :partial_clone_filter partial-clone filter # # @option fields [String, nil] :vcs VCS type # # @return [Git::RemoteInfo] a new instance; `self` when no fields are given # # @raise [ArgumentError] if a key is not a member of this Data class # def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end end |
Instance Method Details
#with(**fields) ⇒ Git::RemoteInfo
Return a copy of this RemoteInfo with the given fields replaced
Routes through #initialize so the multi-value fields of the copy are
frozen copies, the same as on construction. Data#with bypasses
initialize on Ruby 3.2, which would leave those arrays mutable.
197 198 199 200 201 |
# File 'lib/git/remote_info.rb', line 197 def with(**fields) return self if fields.empty? self.class.new(**to_h, **fields) end |