-
-
Notifications
You must be signed in to change notification settings - Fork 80
check for different urls when running haxelib git
#640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ninjamuffin99
wants to merge
11
commits into
HaxeFoundation:development
Choose a base branch
from
FunkinCrew:update-remote-url
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b65c649
check for different urls when running `haxelib git`
ninjamuffin99 e9b1273
remote URL parsing related changes, simply compare if URLs are identi…
ninjamuffin99 f8b0412
Merge branch 'HaxeFoundation:development' into update-remote-url
ninjamuffin99 0ad9428
testing in progress
ninjamuffin99 443689a
add tests for url differences / updates
ninjamuffin99 846dcf8
Get compiler version for run scripts lazily (#646)
tobil4sk 4820514
Change the order of `haxelib git` submodule installation (#638)
ninjamuffin99 da51ad0
remote URL parsing related changes, simply compare if URLs are identi…
ninjamuffin99 6dc4071
Merge remote-tracking branch 'upstream/development' into update-remot…
ninjamuffin99 ce638c6
remove CLI interaction, simply overwrite git url
ninjamuffin99 4c0ba15
run.n
ninjamuffin99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -380,14 +380,18 @@ class Git extends Vcs { | |
Sys.setCwd(libPath); | ||
|
||
final ret: VcsData = { | ||
// `git config --get remote.remoteName.url` will get the original url of the remote | ||
// for usecases where someone has something like `url."[email protected]:".insteadOf 'https://github.com/'` set | ||
|
||
// could the remote's name not be "origin"? | ||
url: run(["remote", "get-url", "origin"], true).out.trim(), | ||
url: run(["config", "--get", "remote.origin.url"], true).out.trim(), | ||
ref: run(["rev-parse", "HEAD"], true).out.trim(), | ||
}; | ||
|
||
Sys.setCwd(oldCwd); | ||
return ret; | ||
} | ||
|
||
} | ||
|
||
/** Class wrapping `hg` operations. **/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-lib flixel:git:https://github.com/geokureli/flixel.git#4.5.0 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-lib flixel:git:https://github.com/HaxeFlixel/flixel.git#4.5.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package tests; | ||
|
||
import haxelib.VersionData.VcsID; | ||
import sys.FileSystem; | ||
import sys.io.File; | ||
import haxe.io.Path; | ||
|
@@ -105,6 +106,19 @@ class TestInstaller extends TestBase { | |
assertTrue(scope.isLibraryInstalled(ProjectName.ofString("hx.signal"))); | ||
} | ||
|
||
public function testInstallUrlChanges() { | ||
installer.installFromHxml("git-deps-url-old.hxml"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For this test, we should run |
||
|
||
assertTrue(scope.isLibraryInstalled(ProjectName.ofString("flixel"))); | ||
assertEquals(scope.repository.getVcsData(ProjectName.ofString("flixel"), VcsID.Git).url, "https://github.com/HaxeFlixel/flixel.git"); | ||
|
||
|
||
installer.installFromHxml("git-deps-url-new.hxml"); | ||
|
||
assertTrue(scope.isLibraryInstalled(ProjectName.ofString("flixel"))); | ||
assertEquals(scope.repository.getVcsData(ProjectName.ofString("flixel"), VcsID.Git).url, "https://github.com/geokureli/flixel.git"); | ||
} | ||
|
||
function getLibraryName():String { | ||
final haxelibFile = File.read("haxelib.json", false); | ||
final details = Data.readData(haxelibFile.readAll().toString(), NoCheck); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be possible to set up a url that is just a path to a local directory. There is a util function for setting up a git repository, and there is a
test/libraries
folder with some existing libraries that could be pointed to.haxelib/test/tests/util/Vcs.hx
Line 8 in 5a83628
haxelib/test/tests/integration/TestVcs.hx
Lines 6 to 8 in 5a83628
External repositories may change ownership or move (and they rely on the network to clone), so it is more reliable to clone from local repositories in tests, especially the unit tests.