Skip to content

Commit c6ab7ff

Browse files
addressed co pilot reviews
1 parent db07310 commit c6ab7ff

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Command/Pull/PullCommandBase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ public static function getBackupPath(object $environment, DatabaseResponse $data
125125
}
126126
if (PHP_OS_FAMILY === 'Windows') {
127127
// Use short filename to comply with 8.3 format and avoid long path issues.
128+
// The hash-based filename still preserves the '.sql.gz' extension.
128129
$hash = substr(md5($environment->name . $database->name . $dbMachineName . $backupResponse->completedAt), 0, 8);
129130
$filename = $hash . '.sql.gz';
130131
} else {
@@ -389,7 +390,7 @@ private function validateDownloadedFile(string $localFilepath): void
389390
}
390391

391392
// Optional: Validate gzip file header (backup files are .sql.gz)
392-
if (str_ends_with($localFilepath, '.gz')) {
393+
if (str_ends_with($localFilepath, '.sql.gz')) {
393394
$this->validateGzipFile($localFilepath);
394395
}
395396
}
@@ -427,7 +428,7 @@ private function validateGzipFile(string $localFilepath): void
427428
if ($byte1 !== 0x1f || $byte2 !== 0x8b) {
428429
$this->localMachineHelper->getFilesystem()->remove($localFilepath);
429430
throw new AcquiaCliException(
430-
'Database backup download failed or returned an invalid response. The downloaded file is not a valid gzip archive. Please try again or contact support.'
431+
'The downloaded file is not a valid gzip archive'
431432
);
432433
}
433434
}

0 commit comments

Comments
 (0)