Skip to content

Commit

Permalink
Merge pull request #1108 from scm-manager/bugfix/fix_protocol_path_fo…
Browse files Browse the repository at this point in the history
…r_windows

Fix git protocol uri for windows
  • Loading branch information
sdorra committed Apr 27, 2020
2 parents 5140bdf + 0f1bc64 commit fd68648
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Removed the `requires` attribute on the `@Extension` annotation and instead create a new `@Requires` annotation ([#1097](https://github.com/scm-manager/scm-manager/pull/1097))

### Fixed
- Protocol URI for git commands under windows ([#1108](https://github.com/scm-manager/scm-manager/pull/1108))

## [2.0.0-rc7] - 2020-04-09
### Added
- Fire various plugin events ([#1088](https://github.com/scm-manager/scm-manager/pull/1088))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package sonia.scm.repository.spi;

import org.eclipse.jgit.api.Git;
Expand All @@ -34,6 +34,7 @@
import sonia.scm.repository.InternalRepositoryException;
import sonia.scm.repository.util.SimpleWorkdirFactory;
import sonia.scm.repository.util.WorkdirProvider;
import sonia.scm.util.SystemUtil;

import javax.inject.Inject;
import java.io.File;
Expand Down Expand Up @@ -72,7 +73,11 @@ public ParentAndClone<Repository, Repository> cloneRepository(GitContext context
}

private String createScmTransportProtocolUri(File bareRepository) {
return ScmTransportProtocol.NAME + "://" + bareRepository.getAbsolutePath();
if (SystemUtil.isWindows()) {
return ScmTransportProtocol.NAME + ":///" + bareRepository.getAbsolutePath().replaceAll("\\\\", "/");
} else {
return ScmTransportProtocol.NAME + "://" + bareRepository.getAbsolutePath();
}
}

@Override
Expand Down

0 comments on commit fd68648

Please sign in to comment.