Creates a new `GitConfig`, first with `new` and then as a GitHub `owner/repo` remote, like [hub]. [hub]: https://github.com/github/hub
(
git: Cow<'a, str>,
branch: Option<String>,
identity: Option<PathBuf>,
)
| 87 | /// |
| 88 | /// [hub]: https://github.com/github/hub |
| 89 | pub fn new_abbr( |
| 90 | git: Cow<'a, str>, |
| 91 | branch: Option<String>, |
| 92 | identity: Option<PathBuf>, |
| 93 | ) -> Result<Self> { |
| 94 | Self::new(git.clone(), branch.clone(), identity.clone()).or_else(|_| { |
| 95 | let full_remote = format!("https://github.com/{}.git", &git); |
| 96 | Self::new(full_remote.into(), branch, identity) |
| 97 | }) |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | pub fn create(project_dir: &Path, config: GitConfig) -> Result<String> { |