Skip to content

Commit

Permalink
chore: push repo feature
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelramos committed Nov 11, 2024
1 parent 394e01e commit c53b873
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/git/src/repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,4 +404,14 @@ impl Repository {
|_, output| Ok(output.status.success()),
)?)
}

pub fn push(&self, follow_tags: Option<bool>) -> Result<bool, RepositoryError> {
let mut args = vec!["push", "--no-verify"];

if follow_tags.unwrap_or(false) {
args.push("--follow-tags");
}

Ok(execute("git", self.location.as_path(), args, |_, output| Ok(output.status.success()))?)
}
}
1 change: 1 addition & 0 deletions crates/git/tests/git_repo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ mod repo_tests {
let tagged = repo.tag("@scope/[email protected]", Some(String::from("feat: 1.0.0 version")))?;
let log = repo.log(None)?;

dbg!(&log);
assert!(tagged);
assert!(log.contains("tag: @scope/[email protected]"));

Expand Down

0 comments on commit c53b873

Please sign in to comment.