Skip to content

Commit fa5c6f9

Browse files
Add run-git parameter to install command
In order to do proper path mapping between host and container the .git dir location has to be known by the Cap'n. If you do not provide that option and do not handle the GIT_INDEX_FILE mapping yourself `git commit -a` will not work.
1 parent 2d52d98 commit fa5c6f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Console/Command/Install.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ protected function configure(): void
9999
'p',
100100
InputOption::VALUE_OPTIONAL,
101101
'The path to the CaptainHook executable \'/usr/bin/captainhook\''
102-
);
102+
)
103+
->addOption(
104+
'run-git',
105+
'd',
106+
InputOption::VALUE_OPTIONAL,
107+
'The absolute path to the .git directory inside the container \'/var/www/html/.git\''
108+
);
103109
}
104110

105111
/**
@@ -113,7 +119,7 @@ protected function configure(): void
113119
protected function execute(InputInterface $input, OutputInterface $output): int
114120
{
115121
try {
116-
$args = ['git-directory', 'run-mode', 'run-exec', 'run-path', 'bootstrap'];
122+
$args = ['git-directory', 'run-mode', 'run-exec', 'run-path', 'run-git', 'bootstrap'];
117123
$io = $this->getIO($input, $output);
118124
$config = $this->createConfig($input, true, $args);
119125
$repo = $this->createRepository(dirname($config->getGitDirectory()));

0 commit comments

Comments
 (0)