Skip to content
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

Don't use a bare checkout of the index #4060

Merged
merged 1 commit into from
May 17, 2017
Merged

Conversation

alexcrichton
Copy link
Member

Both old and new Cargo share the same index, so be sure to maintain
compatibility by initializing a non-bare repository for the index. Note that
a nightly Cargo still won't check out the index, but when an older Cargo comes
along and tries to check it out then it'll work.

Closes #4058

@alexcrichton
Copy link
Member Author

r? @matklad

@rust-highfive
Copy link

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

@matklad
Copy link
Member

matklad commented May 16, 2017

Are there any benefits in creating a bare repository? If there are, we might want to add TODO: switch to init_bare some time in the future when dropping support for cargo 0.17.

@alexcrichton
Copy link
Member Author

It's at least more explicit to our intent, but yeah I'll leave a comment, we'll just need to wait a number of releases to change this. We could also just change the folder we store the index in (there's a hash there anyway), but I figure we don't need to do that just yet.

As for benefits... Unsure! I figure that if you don't check anything out you get basically the same benefits.

Both old and new Cargo share the same index, so be sure to maintain
compatibility by initializing a non-bare repository for the index. Note that
a nightly Cargo still won't check out the index, but when an older Cargo comes
along and tries to check it out then it'll work.

Closes rust-lang#4058
@alexcrichton
Copy link
Member Author

Ok, updated with a comment.

@matklad
Copy link
Member

matklad commented May 16, 2017

@bors r+

@bors
Copy link
Collaborator

bors commented May 16, 2017

📌 Commit 00e5f95 has been approved by matklad

@bors
Copy link
Collaborator

bors commented May 17, 2017

⌛ Testing commit 00e5f95 with merge 2b32084...

bors added a commit that referenced this pull request May 17, 2017
Don't use a bare checkout of the index

Both old and new Cargo share the same index, so be sure to maintain
compatibility by initializing a non-bare repository for the index. Note that
a nightly Cargo still won't check out the index, but when an older Cargo comes
along and tries to check it out then it'll work.

Closes #4058
@bors
Copy link
Collaborator

bors commented May 17, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: matklad
Pushing 2b32084 to master...

@bors bors merged commit 00e5f95 into rust-lang:master May 17, 2017
@alexcrichton alexcrichton deleted the nobare branch June 2, 2017 01:20
est31 added a commit to est31/cargo-local-serve that referenced this pull request Nov 23, 2017
Cargo uses no checkouts any more [1],
but only bare clones of the index repo.

That means that more recent cargo doesn't
update the checkout any more, and one day
the cargo team might consider dropping the
non-bare checkout entirely.

We therefore need to switch to using
libgit2 to obtain the newest index contents.

Also, we start using the failure now.

[1]: rust-lang/cargo#4060
@ehuss ehuss added this to the 1.19.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot reset hard. This operation is not allowed against bare repositories.
6 participants