Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Dec 26, 2021

This PR extracts, simplifies and documents the code that temporarily writes the in-memory SSH key to the disk for consumption in git push when the index is squashed.

@Turbo87 Turbo87 added A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear labels Dec 26, 2021
@Turbo87 Turbo87 changed the title git: Extract write_temporary_ssh_key() function Repository: Extract write_temporary_ssh_key() function Dec 26, 2021
bors added a commit that referenced this pull request Dec 26, 2021
Repository: Extract `run_command()` function

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.
@bors bors merged commit abdaa20 into rust-lang:master Dec 26, 2021
@Turbo87 Turbo87 deleted the key-function 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.

2 participants