aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/owner_repo.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/owner_repo.rs b/src/owner_repo.rs
index ea5a510..273ef6f 100644
--- a/src/owner_repo.rs
+++ b/src/owner_repo.rs
@@ -76,9 +76,13 @@ impl FromStr for OwnerRepo {
return Err(OwnerRepoError::NoOwnerRepo);
}
+ let repo = path[1]
+ .strip_suffix(".git")
+ .unwrap_or(path[1]);
+
Ok(OwnerRepo {
owner: path[0].to_owned(),
- repo: path[1].to_owned(),
+ repo: repo.to_owned(),
})
}
}