Skip to content

Commit

Permalink
fix: replace git:// URIs with https:// (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Oct 22, 2024
1 parent ad8d642 commit b307667
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
46 changes: 23 additions & 23 deletions rocks-lib/src/rockspec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ mod tests {
external_dependencies = { FOO = { header = 'foo.h' } }\n
test_dependencies = { 'busted >= 2.0.0' }\n
source = {\n
url = 'git://github.com/nvim-neorocks/rocks.nvim',\n
url = 'git+https://github.com/nvim-neorocks/rocks.nvim',\n
hash = 'sha256-uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=',\n
}\n
"
Expand Down Expand Up @@ -376,7 +376,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
branch = 'bar',\n
}\n
"
Expand All @@ -385,7 +385,7 @@ mod tests {
assert_eq!(
rockspec.source.default.source_spec,
RockSourceSpec::Git(GitSource {
url: "git://hub.com/example-project/".parse().unwrap(),
url: "https://hub.com/example-project/".parse().unwrap(),
checkout_ref: Some("bar".into())
})
);
Expand All @@ -395,7 +395,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
tag = 'bar',\n
}\n
"
Expand All @@ -404,7 +404,7 @@ mod tests {
assert_eq!(
rockspec.source.default.source_spec,
RockSourceSpec::Git(GitSource {
url: "git://hub.com/example-project/".parse().unwrap(),
url: "https://hub.com/example-project/".parse().unwrap(),
checkout_ref: Some("bar".into())
})
);
Expand All @@ -413,7 +413,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
branch = 'bar',\n
tag = 'baz',\n
}\n
Expand All @@ -425,7 +425,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
module = 'bar',\n
}\n
"
Expand All @@ -436,7 +436,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
tag = 'bar',\n
file = 'foo.tar.gz',\n
}\n
Expand All @@ -459,7 +459,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/foo.zip',\n
url = 'git+https://hub.com/example-project/foo.zip',\n
}\n
build = {\n
install = {\n
Expand All @@ -483,7 +483,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
}\n
build = {\n
copy_directories = { 'lua' },\n
Expand All @@ -496,7 +496,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
}\n
build = {\n
copy_directories = { 'lib' },\n
Expand All @@ -509,7 +509,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/',\n
url = 'git+https://hub.com/example-project/',\n
}\n
build = {\n
copy_directories = { 'rock_manifest' },\n
Expand All @@ -522,7 +522,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/foo.zip',\n
url = 'git+https://hub.com/example-project/foo.zip',\n
dir = 'baz',\n
}\n
build = {\n
Expand Down Expand Up @@ -563,7 +563,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/foo.zip',\n
url = 'git+https://hub.com/example-project/foo.zip',\n
}\n
build = {\n
type = 'cmake',\n
Expand All @@ -580,7 +580,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/foo.zip',\n
url = 'git+https://hub.com/example-project/foo.zip',\n
}\n
build = {\n
type = 'command',\n
Expand All @@ -599,7 +599,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/foo.zip',\n
url = 'git+https://hub.com/example-project/foo.zip',\n
}\n
build = {\n
type = 'command',\n
Expand All @@ -613,7 +613,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/foo.zip',\n
url = 'git+https://hub.com/example-project/foo.zip',\n
}\n
build = {\n
type = 'command',\n
Expand Down Expand Up @@ -643,7 +643,7 @@ mod tests {
},\n
}\n
source = {\n
url = 'git://github.com/nvim-neorocks/rocks.nvim',\n
url = 'git+https://github.com/nvim-neorocks/rocks.nvim',\n
hash = 'sha256-uU0nuZNNPgilLlLX2n2r+sSE7+N6U4DukIj3rOLvzek=',\n
}\n
"
Expand Down Expand Up @@ -755,7 +755,7 @@ mod tests {
package = 'foo'\n
version = '1.0.0-1'\n
source = {\n
url = 'git://hub.com/example-project/.git',\n
url = 'git+https://hub.com/example-project/.git',\n
branch = 'bar',\n
platforms = {\n
macosx = {\n
Expand All @@ -773,7 +773,7 @@ mod tests {
assert_eq!(
rockspec.source.default.source_spec,
RockSourceSpec::Git(GitSource {
url: "git://hub.com/example-project/.git".parse().unwrap(),
url: "https://hub.com/example-project/.git".parse().unwrap(),
checkout_ref: Some("bar".into())
})
);
Expand All @@ -785,7 +785,7 @@ mod tests {
.map(|it| it.source_spec.clone())
.unwrap(),
RockSourceSpec::Git(GitSource {
url: "git://hub.com/example-project/.git".parse().unwrap(),
url: "https://hub.com/example-project/.git".parse().unwrap(),
checkout_ref: Some("mac".into())
})
);
Expand All @@ -805,7 +805,7 @@ mod tests {
rockspec_format = '1.0'\n
package = 'foo'\n
version = '1.0.0-1'\n
source = { url = 'git://hub.com/example-project/foo.zip' }\n
source = { url = 'git+https://hub.com/example-project/foo.zip' }\n
build = {\n
type = 'make',\n
install = {\n
Expand Down Expand Up @@ -842,7 +842,7 @@ mod tests {
let rockspec_content = "
package = 'foo'\n
version = '1.0.0-1'\n
source = { url = 'git://hub.com/example-project/foo.zip' }\n
source = { url = 'git+https://hub.com/example-project/foo.zip' }\n
build = {\n
type = 'builtin',\n
modules = {\n
Expand Down
2 changes: 1 addition & 1 deletion rocks-lib/src/rockspec/rock_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ impl FromStr for SourceUrl {
let path = fs::canonicalize(&path_buf)?;
Ok(Self::File(path))
}
s if s.starts_with("git://") => Ok(Self::Git(s.parse()?)),
s if s.starts_with("git://") => Ok(Self::Git(s.replacen("git", "https", 1).parse()?)),
s if starts_with_any(
s,
["git+file://", "git+http://", "git+https://", "git+ssh://"].into(),
Expand Down

0 comments on commit b307667

Please sign in to comment.