@@ -22,7 +22,7 @@ pub use sync::{
2222pub struct Remote {
2323 /// Name of the remote (e.g., "origin")
2424 pub name : String ,
25- /// URL of the remote (e.g., "username/repo" or "https://indra.dev /username/repo")
25+ /// URL of the remote (e.g., "username/repo" or "https://indradb.net /username/repo")
2626 pub url : String ,
2727 /// Last known HEAD commit hash on the remote
2828 #[ serde( default ) ]
@@ -46,11 +46,16 @@ impl Remote {
4646 pub fn parse_url ( & self ) -> Option < ( String , String ) > {
4747 let url = self . url . trim ( ) ;
4848
49- // Handle full URLs: https://indra.dev /username/repo
49+ // Handle full URLs: https://indradb.net /username/repo
5050 if url. starts_with ( "https://" ) || url. starts_with ( "http://" ) {
5151 let path = url
5252 . trim_start_matches ( "https://" )
5353 . trim_start_matches ( "http://" )
54+ . trim_start_matches ( "indradb.net/" )
55+ . trim_start_matches ( "api.indradb.net/" )
56+ // Legacy domain support
57+ . trim_start_matches ( "indra.net/" )
58+ . trim_start_matches ( "api.indra.net/" )
5459 . trim_start_matches ( "indra.dev/" )
5560 . trim_start_matches ( "api.indra.dev/" ) ;
5661 return Self :: parse_path ( path) ;
@@ -232,13 +237,20 @@ mod tests {
232237 Some ( ( "username" . to_string( ) , "repo" . to_string( ) ) )
233238 ) ;
234239
235- let remote = Remote :: new ( "origin" , "https://indra.dev /username/repo" ) ;
240+ let remote = Remote :: new ( "origin" , "https://indradb.net /username/repo" ) ;
236241 assert_eq ! (
237242 remote. parse_url( ) ,
238243 Some ( ( "username" . to_string( ) , "repo" . to_string( ) ) )
239244 ) ;
240245
241- let remote = Remote :: new ( "origin" , "https://api.indra.dev/username/repo" ) ;
246+ let remote = Remote :: new ( "origin" , "https://api.indradb.net/username/repo" ) ;
247+ assert_eq ! (
248+ remote. parse_url( ) ,
249+ Some ( ( "username" . to_string( ) , "repo" . to_string( ) ) )
250+ ) ;
251+
252+ // Legacy domains should still work
253+ let remote = Remote :: new ( "origin" , "https://indra.dev/username/repo" ) ;
242254 assert_eq ! (
243255 remote. parse_url( ) ,
244256 Some ( ( "username" . to_string( ) , "repo" . to_string( ) ) )
0 commit comments