Skip to content

Commit

Permalink
Fix git refs not showing on Windows
Browse files Browse the repository at this point in the history
Fix git refs now showing on some Windows shells by replacing ; between commands
with && and removing them at the end of commands.
Add a switch that enables Windows to switch between drives.
  • Loading branch information
haszi authored and Girgias committed Jan 31, 2024
1 parent 1c56d26 commit 6f04778
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,11 @@ function generate_sources_file() // {{{

foreach ($repos as $name => $path)
{
$driveSwitch = is_windows() ? '/d' : '';
$output = str_pad( "$name:" , 10 );
$output .= `cd $path; git rev-parse HEAD;`;
$output .= `cd $path; git status -s;`;
$output .= `cd $path; git for-each-ref --format="%(push:track)" refs/heads`;
$output .= `cd $driveSwitch $path && git rev-parse HEAD`;
$output .= `cd $driveSwitch $path && git status -s`;
$output .= `cd $driveSwitch $path && git for-each-ref --format="%(push:track)" refs/heads`;
echo trim($output) . "\n";
}
echo "\n";
Expand Down

0 comments on commit 6f04778

Please sign in to comment.