Fix to allow any remote name to be used#413
Conversation
Fixes killercup#411 TODO: Is it ok if we take the first one we find. Are there any examples of having more than one file in 'refs/remotes/origin/'?.
|
AppVeyor build fails on linking. Looks like this is the build not these changes, as I found the same in other PR-s. |
src/fetch.rs
Outdated
| let checkout_dir = registry_path.as_ref().join(".git").join(&remotes); | ||
| let checkout = checkout_dir | ||
| .read_dir()? | ||
| .next() // Is there always only one branch? (expecting either master og HEAD) |
There was a problem hiding this comment.
I think it would be safer to try only known names master and if it fails, then HEAD
There was a problem hiding this comment.
I think this is mostly ok. I wanted to know if there are any reference on how cargo deals according to this. As I think most users will never toutch this location I think it should be fine. If we want to check for names i would rather collect them into a vec and then first check master then HEAD then first element. Not sure about that order either.
still todo: What to do with when we get unkown or no checkouts
ordian
left a comment
There was a problem hiding this comment.
Thanks! (sorry for the delay)
|
@killercup do you know what happened to travis CI? Can't merge the PR, tests seem to pass locally. |
|
No idea, the build doesn't appear in the travis dashboard for some reason. I'll force merge it. |
|
Github Action's CI now tells me some checks fail: https://github.com/killercup/cargo-edit/actions/runs/197551357 I dont have time to look into it right now, but it'd be cool if we can get a fix fo this merged soon. |
|
ah, that's clippy and fmt, windows was failing before due to #377 |
Fixes #411
TODO: Is it ok if we take the first one we find. Are there any examples
of having more than one file in
refs/remotes/origin/?.