Skip to content

Commit 7779606

Browse files
committed
Auto merge of #11475 - Chocobo1:gitUrl, r=weihanglo
Use proper git URL for GitHub repos It can be seen in the following link that a git repo URL from GitHub should end with ".git": https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#about-remote-repositories
2 parents 0409e39 + ce174d4 commit 7779606

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/doc/src/reference/overriding-dependencies.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ request is merged you could change your `path` dependency to:
108108

109109
```toml
110110
[patch.crates-io]
111-
uuid = { git = 'https://github.com/uuid-rs/uuid' }
111+
uuid = { git = 'https://github.com/uuid-rs/uuid.git' }
112112
```
113113

114114
[uuid-repository]: https://github.com/uuid-rs/uuid
@@ -135,7 +135,7 @@ version = "0.1.0"
135135
uuid = "1.0.1"
136136

137137
[patch.crates-io]
138-
uuid = { git = 'https://github.com/uuid-rs/uuid' }
138+
uuid = { git = 'https://github.com/uuid-rs/uuid.git' }
139139
```
140140

141141
Note that our local dependency on `uuid` has been updated to `1.0.1` as it's
@@ -161,7 +161,7 @@ my-library = { git = 'https://example.com/git/my-library' }
161161
uuid = "1.0"
162162

163163
[patch.crates-io]
164-
uuid = { git = 'https://github.com/uuid-rs/uuid' }
164+
uuid = { git = 'https://github.com/uuid-rs/uuid.git' }
165165
```
166166

167167
Remember that `[patch]` is applicable *transitively* but can only be defined at
@@ -197,7 +197,7 @@ we've submitted all changes upstream we can update our manifest for
197197
uuid = "2.0"
198198

199199
[patch.crates-io]
200-
uuid = { git = "https://github.com/uuid-rs/uuid", branch = "2.0.0" }
200+
uuid = { git = "https://github.com/uuid-rs/uuid.git", branch = "2.0.0" }
201201
```
202202

203203
And that's it! Like with the previous example the 2.0.0 version doesn't actually
@@ -215,7 +215,7 @@ my-library = { git = 'https://example.com/git/my-library' }
215215
uuid = "1.0"
216216

217217
[patch.crates-io]
218-
uuid = { git = 'https://github.com/uuid-rs/uuid', branch = '2.0.0' }
218+
uuid = { git = 'https://github.com/uuid-rs/uuid.git', branch = '2.0.0' }
219219
```
220220

221221
Note that this will actually resolve to two versions of the `uuid` crate. The
@@ -234,8 +234,8 @@ configure this we'd do:
234234

235235
```toml
236236
[patch.crates-io]
237-
serde = { git = 'https://github.com/serde-rs/serde' }
238-
serde2 = { git = 'https://github.com/example/serde', package = 'serde', branch = 'v2' }
237+
serde = { git = 'https://github.com/serde-rs/serde.git' }
238+
serde2 = { git = 'https://github.com/example/serde.git', package = 'serde', branch = 'v2' }
239239
```
240240

241241
The first `serde = ...` directive indicates that serde `1.*` should be used
@@ -256,14 +256,14 @@ with other copies. The syntax is similar to the
256256

257257
```toml
258258
[patch.crates-io]
259-
foo = { git = 'https://github.com/example/foo' }
259+
foo = { git = 'https://github.com/example/foo.git' }
260260
bar = { path = 'my/local/bar' }
261261

262262
[dependencies.baz]
263-
git = 'https://github.com/example/baz'
263+
git = 'https://github.com/example/baz.git'
264264

265265
[patch.'https://github.com/example/baz']
266-
baz = { git = 'https://github.com/example/patched-baz', branch = 'my-branch' }
266+
baz = { git = 'https://github.com/example/patched-baz.git', branch = 'my-branch' }
267267
```
268268

269269
> **Note**: The `[patch]` table can also be specified as a [configuration
@@ -305,7 +305,7 @@ copies. The syntax is similar to the `[dependencies]` section:
305305

306306
```toml
307307
[replace]
308-
"foo:0.1.0" = { git = 'https://github.com/example/foo' }
308+
"foo:0.1.0" = { git = 'https://github.com/example/foo.git' }
309309
"bar:1.0.2" = { path = 'my/local/bar' }
310310
```
311311

src/doc/src/reference/specifying-dependencies.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ you need to specify is the location of the repository with the `git` key:
131131

132132
```toml
133133
[dependencies]
134-
regex = { git = "https://github.com/rust-lang/regex" }
134+
regex = { git = "https://github.com/rust-lang/regex.git" }
135135
```
136136

137137
Cargo will fetch the `git` repository at this location then look for a
@@ -147,7 +147,7 @@ the latest commit on a branch named `next`:
147147

148148
```toml
149149
[dependencies]
150-
regex = { git = "https://github.com/rust-lang/regex", branch = "next" }
150+
regex = { git = "https://github.com/rust-lang/regex.git", branch = "next" }
151151
```
152152

153153
Anything that is not a branch or tag falls under `rev`. This can be a commit
@@ -227,7 +227,7 @@ bitflags = { path = "my-bitflags", version = "1.0" }
227227

228228
# Uses the given git repo when used locally, and uses
229229
# version 1.0 from crates.io when published.
230-
smallvec = { git = "https://github.com/servo/rust-smallvec", version = "1.0" }
230+
smallvec = { git = "https://github.com/servo/rust-smallvec.git", version = "1.0" }
231231

232232
# N.B. that if a version doesn't match, Cargo will fail to compile!
233233
```
@@ -417,7 +417,7 @@ version = "0.0.1"
417417

418418
[dependencies]
419419
foo = "0.1"
420-
bar = { git = "https://github.com/example/project", package = "foo" }
420+
bar = { git = "https://github.com/example/project.git", package = "foo" }
421421
baz = { version = "0.1", registry = "custom", package = "foo" }
422422
```
423423

0 commit comments

Comments
 (0)