Remove remote editing from the Git sidebar
This commit is contained in:
@@ -502,22 +502,6 @@ impl GitEngine {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn set_remote(&self, remote_url: &str) -> Result<(), GitError> {
|
||||
let remote_url = remote_url.trim();
|
||||
if remote_url.is_empty() {
|
||||
return Err(GitError::Validation("remote URL is required".into()));
|
||||
}
|
||||
let args = if self
|
||||
.optional_output(&["remote", "get-url", "origin"], GitOperation::Remote)?
|
||||
.is_some()
|
||||
{
|
||||
["remote", "set-url", "origin", remote_url]
|
||||
} else {
|
||||
["remote", "add", "origin", remote_url]
|
||||
};
|
||||
self.run_local(&args, GitOperation::Remote).map(|_| ())
|
||||
}
|
||||
|
||||
pub fn commit_all(&self, message: &str) -> Result<NetworkResult, GitError> {
|
||||
let message = message.trim();
|
||||
if message.is_empty() {
|
||||
|
||||
@@ -134,7 +134,10 @@ fn remote_state_history_fetch_and_fast_forward_pull_use_real_refs() {
|
||||
git(&local, &["add", "-A"]);
|
||||
git(&local, &["commit", "-m", "local one"]);
|
||||
let engine = GitEngine::new(&local);
|
||||
engine.set_remote(remote.to_str().unwrap()).unwrap();
|
||||
git(
|
||||
&local,
|
||||
&["remote", "add", "origin", remote.to_str().unwrap()],
|
||||
);
|
||||
git(&local, &["push", "-u", "origin", "master"]);
|
||||
|
||||
git(
|
||||
|
||||
Reference in New Issue
Block a user