Skip to content

Commit a2b87b8

Browse files
committed
Changed the way this works to support stable rust
1 parent 0c93684 commit a2b87b8

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

src/git.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,21 @@ use std::env::current_dir;
22
use std::process::Command;
33

44
pub fn add_remote(name: &str, url: &str) -> bool {
5-
match (current_dir(), can_create_remote(name)) {
6-
(Ok(dir), true) if dir.ancestors().any(|p| p.join(".git").exists()) => Command::new("git")
7-
.arg("remote")
8-
.arg("add")
9-
.arg(name)
10-
.arg(url)
11-
.output()
12-
.is_ok(),
13-
_ => false,
5+
if can_create_remote(name) {
6+
if let Ok(dir) = current_dir() {
7+
if dir.ancestors().any(|p| p.join(".git").exists()) {
8+
return Command::new("git")
9+
.arg("remote")
10+
.arg("add")
11+
.arg(name)
12+
.arg(url)
13+
.output()
14+
.is_ok();
15+
}
16+
}
1417
}
18+
19+
false
1520
}
1621

1722
fn can_create_remote(name: &str) -> bool {

src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(bind_by_move_pattern_guards)]
2-
31
use cli::Gitpo;
42
use reqwest::StatusCode;
53
use std::process::exit;

0 commit comments

Comments
 (0)