Skip to content

Commit

Permalink
Merge pull request #171 from JarvusInnovations/develop
Browse files Browse the repository at this point in the history
Release: emergence-skeleton v1.3.17
  • Loading branch information
themightychris authored Nov 9, 2018
2 parents a92074d + 78aa57a commit 99eace1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions php-classes/Emergence/Git/Source.php
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,22 @@ public function syncFromVfs()
$results[$treeOptions['vfsPath']] = $result;
}

// analyze mode changes
$diff = $this->getRepository()->run('diff', ['--summary']);
$diff = explode(PHP_EOL, $diff);

foreach ($diff as $diffLine) {
$diffLine = trim($diffLine);

if (!preg_match('/^mode change (?<modeFrom>\d+) => (?<modeTo>\d+) (?<path>.+?)$/', $diffLine, $matches)) {
continue;
}

if ($matches['modeFrom'] == '100755') {
chmod($matches['path'], 0755);
}
}

return $results;
}

Expand Down

0 comments on commit 99eace1

Please sign in to comment.