@@ -14,31 +14,31 @@ impl SastTool {
1414    pub  async  fn  run_scan ( 
1515        & self , 
1616        _path :  & str , 
17-         _commit_id :  Option < & str > , 
18-         _branch :  Option < & str > , 
17+         base_branch :  Option < & str > , 
18+         pr_branch :  Option < & str > , 
1919        rule_path :  String , 
2020        verbose :  bool , 
2121    )  { 
2222        let  start_time = Instant :: now ( ) ; 
2323        if  verbose { 
2424            println ! ( "[+] Running SAST scan on path: {}" ,  _path) ; 
2525        } 
26-         println ! ( "Commit ID : {:?}" ,  _commit_id ) ; 
27-         println ! ( "Branch: {:?}" ,  _branch ) ; 
26+         println ! ( "Base Branch : {:?}" ,  base_branch ) ; 
27+         println ! ( "PR  Branch: {:?}" ,  pr_branch ) ; 
2828        if  !std:: path:: Path :: new ( "/tmp/app" ) . exists ( )  { 
2929            if  _path. starts_with ( "http" )  { 
3030                if  verbose { 
3131                    println ! ( "[+] Cloning git repo..." ) ; 
3232                } 
33-                 if  let  Some ( _branch )  = _branch  { 
34-                     if  _commit_id . is_some ( )  { 
35-                         let  branch = Some ( _branch ) ; 
36-                         let  out = checkout ( _path,  "/tmp/app" ,  _commit_id ,  branch) ; 
33+                 if  let  Some ( pr_branch )  = pr_branch  { 
34+                     if  base_branch . is_some ( )  { 
35+                         let  branch = Some ( pr_branch ) ; 
36+                         let  out = checkout ( _path,  "/tmp/app" ,  base_branch ,  branch) ; 
3737                        if  out. is_err ( )  { 
3838                            println ! ( "Error while cloning: {}" ,  out. err( ) . unwrap( ) ) ; 
3939                        } 
4040                    }  else  { 
41-                         let  branch = Some ( _branch ) ; 
41+                         let  branch = Some ( pr_branch ) ; 
4242                        let  out = checkout ( _path,  "/tmp/app" ,  None ,  branch) ; 
4343                        if  out. is_err ( )  { 
4444                            println ! ( "Error while cloning: {}" ,  out. err( ) . unwrap( ) ) ; 
0 commit comments