diff --git a/src/MagentoHackathon/Composer/Magento/GitIgnore.php b/src/MagentoHackathon/Composer/Magento/GitIgnore.php index 4ac6f8df..c0c749b0 100644 --- a/src/MagentoHackathon/Composer/Magento/GitIgnore.php +++ b/src/MagentoHackathon/Composer/Magento/GitIgnore.php @@ -41,6 +41,7 @@ public function __construct($fileLocation) public function addEntry($file) { $file = $this->prependSlashIfNotExist($file); + $file = $this->normalizePath($file); if (!isset($this->lines[$file])) { $this->lines[$file] = $file; } @@ -63,6 +64,7 @@ public function addMultipleEntries(array $files) public function removeEntry($file) { $file = $this->prependSlashIfNotExist($file); + $file = $this->normalizePath($file); if (isset($this->lines[$file])) { unset($this->lines[$file]); $this->hasChanges = true; @@ -108,4 +110,16 @@ private function prependSlashIfNotExist($file) { return sprintf('/%s', ltrim($file, '/')); } + + /** + * Normalizes paths to UNIX format + * + * @param string $file + * @return string + */ + private function normalizePath($file) + { + return str_replace(DIRECTORY_SEPARATOR, '/', $file); + } + } diff --git a/tests/res/fixtures/modman.new_format b/tests/res/fixtures/modman.new_format old mode 100755 new mode 100644