Skip to content

Commit c5910b4

Browse files
committed
Fix change of repo name after full import
If a repository is imported successfully but import_full() does not actually return any changesets, the temp repo created for the import remains with its `Import <timestamp>` name instead of being renamed to the original repo's name, and the latter is deleted. Setting the temp repo's name right after the initial save operation prevents this unwanted behavior. Fixes #245
1 parent 3cf36d0 commit c5910b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Source/pages/repo_import_full.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@
2323
$t_new_repo->name = 'Import ' . date( 'Y-m-d H:i:s' );
2424
$t_new_repo->save();
2525

26+
# Set the temp repo's name so it displays the correct value during import
27+
# and when saved at the end
28+
$t_new_repo->name = $t_repo->name;
29+
2630
# keep checking for more changesets to import
2731
$t_error = false;
2832
while( true ) {
29-
3033
# import the next batch of changesets
3134
$t_changesets = $t_vcs->import_full( $t_new_repo );
3235

@@ -41,7 +44,6 @@
4144
break;
4245
}
4346

44-
$t_new_repo->name = $t_repo->name;
4547
Source_Process_Changesets( $t_changesets, $t_new_repo );
4648
}
4749

0 commit comments

Comments
 (0)