Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support and Travis CI #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: php

php:
- 7.3
- 7.2
- 7.1
- 7.0

before_install:
- composer install --no-interaction --no-progress --quiet

script:
- vendor/bin/phpunit tests
2 changes: 1 addition & 1 deletion Service/GitExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function applyPatch($patch_text) {
public function commit($message) {
// Allow empty commits, for local patches and also in case two sequential
// patches are identical.
shell_exec("git commit --allow-empty --message='$message'");
shell_exec(sprintf('git commit --allow-empty "--message=%s"', $message));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion Service/GitInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getBranchList() {
$branch_list = [];

// Get the list of local branches as 'SHA BRANCHNAME'.
$refs = shell_exec("git for-each-ref refs/heads/ --format='%(objectname) %(refname:short)'");
$refs = shell_exec('git for-each-ref refs/heads/ "--format=%(objectname) %(refname:short)"');
foreach (explode("\n", trim($refs)) as $line) {
list($sha, $branch_name) = explode(' ', $line);

Expand Down
5 changes: 3 additions & 2 deletions Service/GitLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function getPartialFeatureBranchLog($commit) {
* The raw output from git rev-list.
*/
protected function getLog($old, $new) {
$git_log = shell_exec("git rev-list {$new} ^{$old} --pretty=oneline --reverse");
$git_log = shell_exec("git rev-list {$new} \"^{$old}\" --pretty=oneline --reverse");

return $git_log;
}
Expand All @@ -87,7 +87,8 @@ protected function parseLog($log) {
$feature_branch_log = [];

if (!empty($log)) {
$git_log_lines = explode("\n", rtrim($log));
$any_newline = '/\r\n|\n/';
$git_log_lines = preg_split($any_newline, rtrim($log));
foreach ($git_log_lines as $line) {
list($sha, $message) = explode(' ', $line, 2);
//dump("$sha ::: $message");
Expand Down
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,10 @@
"psr-4": {
"Dorgflow\\": ""
}
},
"autoload-dev": {
"psr-4": {
"Dorgflow\\Tests\\": "tests"
}
}
}