File tree Expand file tree Collapse file tree 4 files changed +12
-7
lines changed
Expand file tree Collapse file tree 4 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ impl Command for PrCommand {
7070 async move {
7171 (
7272 repo. name . clone ( ) ,
73- github:: create_pull_request ( & repo, & pr_options) . await ,
73+ github:: create_pr_from_workspace ( & repo, & pr_options) . await ,
7474 )
7575 }
7676 } )
@@ -88,7 +88,7 @@ impl Command for PrCommand {
8888 }
8989 } else {
9090 for repo in repositories {
91- match github:: create_pull_request ( & repo, & pr_options) . await {
91+ match github:: create_pr_from_workspace ( & repo, & pr_options) . await {
9292 Ok ( _) => successful += 1 ,
9393 Err ( e) => {
9494 eprintln ! (
Original file line number Diff line number Diff line change @@ -9,8 +9,13 @@ use anyhow::Result;
99use colored:: * ;
1010use uuid:: Uuid ;
1111
12- /// Create a pull request for a repository
13- pub async fn create_pull_request ( repo : & Repository , options : & PrOptions ) -> Result < ( ) > {
12+ /// High-level function to create a PR from local changes
13+ ///
14+ /// This function encapsulates the entire pull request creation flow:
15+ /// 1. Check for changes in the workspace
16+ /// 2. Create branch, add, commit, and push changes
17+ /// 3. Create GitHub PR via API
18+ pub async fn create_pr_from_workspace ( repo : & Repository , options : & PrOptions ) -> Result < ( ) > {
1419 let repo_path = repo. get_target_dir ( ) ;
1520
1621 // Check if repository has changes
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ pub mod client;
66pub mod types;
77
88// Re-export commonly used items for convenience
9- pub use api:: create_pull_request ;
9+ pub use api:: create_pr_from_workspace ;
1010pub use auth:: GitHubAuth ;
1111pub use client:: GitHubClient ;
1212pub use types:: { PrOptions , PullRequestParams } ;
Original file line number Diff line number Diff line change 11//! GitHub API tests focusing on PR creation functionality
22
33use repos:: config:: Repository ;
4- use repos:: github:: api:: create_pull_request ;
4+ use repos:: github:: api:: create_pr_from_workspace ;
55use repos:: github:: types:: PrOptions ;
66use std:: fs;
77use std:: path:: PathBuf ;
@@ -54,7 +54,7 @@ async fn test_create_pull_request_no_changes() {
5454 ) ;
5555
5656 // Should succeed with no changes (just prints a message and returns Ok)
57- let result = create_pull_request ( & repo, & options) . await ;
57+ let result = create_pr_from_workspace ( & repo, & options) . await ;
5858 assert ! ( result. is_ok( ) ) ;
5959}
6060
You can’t perform that action at this time.
0 commit comments