1+ use crate :: models:: GitRepository ;
12use crate :: Result ;
2- use serde:: { Deserialize , Serialize } ;
33use std:: path:: Path ;
44use std:: process:: Command ;
55
6- #[ derive( Debug , Clone , Serialize , Deserialize , PartialEq ) ]
7- pub struct GitRepositoryInfo {
8- pub user_name : String ,
9- pub repository_name : String ,
10- pub remote_url : String ,
11- pub branch : Option < String > ,
12- pub commit_hash : Option < String > ,
13- pub is_dirty : bool ,
14- }
6+ // Re-export for backward compatibility - removed duplicate import
157
16- pub struct GitInfoExtractor ;
8+ pub struct GitRepositoryExtractor ;
179
18- impl Default for GitInfoExtractor {
10+ impl Default for GitRepositoryExtractor {
1911 fn default ( ) -> Self {
2012 Self :: new ( )
2113 }
2214}
2315
24- impl GitInfoExtractor {
16+ impl GitRepositoryExtractor {
2517 pub fn new ( ) -> Self {
2618 Self
2719 }
2820
29- pub fn extract_git_info ( repo_path : & Path ) -> Result < Option < GitRepositoryInfo > > {
21+ pub fn extract_git_repository ( repo_path : & Path ) -> Result < Option < GitRepository > > {
3022 // Canonicalize the path to handle relative paths like ../../
3123 let canonical_path = match repo_path. canonicalize ( ) {
3224 Ok ( path) => path,
@@ -48,7 +40,7 @@ impl GitInfoExtractor {
4840 let commit_hash = Self :: get_current_commit_hash ( & git_root) . ok ( ) ;
4941 let is_dirty = Self :: is_working_directory_dirty ( & git_root) . unwrap_or ( false ) ;
5042
51- Ok ( Some ( GitRepositoryInfo {
43+ Ok ( Some ( GitRepository {
5244 user_name,
5345 repository_name,
5446 remote_url,
0 commit comments