Refactored GitRepo associated functions
Strings representing where to run commands where one of: .current_dir(&(self.path.to_owned() + &self.name)) .current_dir(format!("{}{}", &self.path, &self.name)) Decided to change all instances to the latter, as asking people seemed to prefer it for readability. Signed-off-by: Christina Sørensen <christina@cafkafk.com>
This commit is contained in:
parent
82089f213e
commit
eb92038fbf
1 changed files with 4 additions and 4 deletions
|
@ -98,7 +98,7 @@ impl GitRepo {
|
||||||
/// Pulls the repository if able.
|
/// Pulls the repository if able.
|
||||||
fn pull(&self) {
|
fn pull(&self) {
|
||||||
let out = Command::new("git")
|
let out = Command::new("git")
|
||||||
.current_dir(&(self.path.to_owned() + &self.name))
|
.current_dir(format!("{}{}", &self.path, &self.name))
|
||||||
.arg("pull")
|
.arg("pull")
|
||||||
.status()
|
.status()
|
||||||
.expect("failed to pull");
|
.expect("failed to pull");
|
||||||
|
@ -118,7 +118,7 @@ impl GitRepo {
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
fn commit(&self) {
|
fn commit(&self) {
|
||||||
let out = Command::new("git")
|
let out = Command::new("git")
|
||||||
.current_dir(&(self.path.to_owned() + &self.name))
|
.current_dir(format!("{}{}", &self.path, &self.name))
|
||||||
.arg("commit")
|
.arg("commit")
|
||||||
.status()
|
.status()
|
||||||
.expect("failed to commit");
|
.expect("failed to commit");
|
||||||
|
@ -127,7 +127,7 @@ impl GitRepo {
|
||||||
/// Tries to commit changes with a message argument.
|
/// Tries to commit changes with a message argument.
|
||||||
fn commit_with_msg(&self, msg: &String) {
|
fn commit_with_msg(&self, msg: &String) {
|
||||||
let out = Command::new("git")
|
let out = Command::new("git")
|
||||||
.current_dir(&(self.path.to_owned() + &self.name))
|
.current_dir(format!("{}{}", &self.path, &self.name))
|
||||||
.arg("commit")
|
.arg("commit")
|
||||||
.arg("-m")
|
.arg("-m")
|
||||||
.arg(msg)
|
.arg(msg)
|
||||||
|
@ -138,7 +138,7 @@ impl GitRepo {
|
||||||
/// Attempts to push the repository.
|
/// Attempts to push the repository.
|
||||||
fn push(&self) {
|
fn push(&self) {
|
||||||
let out = Command::new("git")
|
let out = Command::new("git")
|
||||||
.current_dir(&(self.path.to_owned() + &self.name))
|
.current_dir(format!("{}{}", &self.path, &self.name))
|
||||||
.arg("push")
|
.arg("push")
|
||||||
.status()
|
.status()
|
||||||
.expect("failed to push");
|
.expect("failed to push");
|
||||||
|
|
Loading…
Reference in a new issue