Skip to content

Repository: Extract run_command() function #4365

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

Merged
merged 6 commits into from
Dec 26, 2021

Conversation

Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Dec 26, 2021

This new function makes it easier to run arbitrary git commands in the working folder of the local index clone. It was extracted from the squash_index() background worker tasks, which uses it to run git push --force-with-lease, which is not yet supported by the git2 crate.

The main goal of this PR is to reduce the visibility of the checkout_path and credentials fields on the Repository, which outside code should ideally not have any access to.

Note that this includes the commits from and is based on #4363.

@Turbo87 Turbo87 added A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Dec 26, 2021
@locks
Copy link
Contributor

locks commented Dec 26, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Dec 26, 2021

📌 Commit 4c63e20 has been approved by locks

@bors
Copy link
Contributor

bors commented Dec 26, 2021

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout git-run-command (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self git-run-command --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging src/git.rs
CONFLICT (content): Merge conflict in src/git.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors
Copy link
Contributor

bors commented Dec 26, 2021

☔ The latest upstream changes (presumably #4364) made this pull request unmergeable. Please resolve the merge conflicts.

@Turbo87
Copy link
Member Author

Turbo87 commented Dec 26, 2021

@bors r=locks

@bors
Copy link
Contributor

bors commented Dec 26, 2021

📌 Commit eb2f671 has been approved by locks

@bors
Copy link
Contributor

bors commented Dec 26, 2021

⌛ Testing commit eb2f671 with merge 0409e47...

@bors
Copy link
Contributor

bors commented Dec 26, 2021

☀️ Test successful - checks-actions
Approved by: locks
Pushing 0409e47 to master...

@bors bors merged commit 0409e47 into rust-lang:master Dec 26, 2021
@Turbo87 Turbo87 deleted the git-run-command branch December 26, 2021 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants