From f8c5ca9ca38908124e419e2ff5bb77b3799e54c9 Mon Sep 17 00:00:00 2001 From: James Moger Date: Thu, 17 Apr 2014 20:04:56 -0400 Subject: [PATCH] Strip leading / from a repository name on ssh fetch/push --- .../java/com/gitblit/transport/ssh/git/BaseGitCommand.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java b/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java index 029dd735..c49d23b6 100644 --- a/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java +++ b/src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java @@ -86,10 +86,9 @@ abstract class BaseGitCommand extends BaseCommand { repository = repository.replace('\\', '/'); // ssh://git@thishost/path should always be name="/path" here // - if (!repository.startsWith("/")) { - throw new Failure(1, "fatal: '" + repository + "': not starts with / character"); + if (repository.startsWith("/")) { + repository = repository.substring(1); } - repository = repository.substring(1); try { return repositoryResolver.open(getContext().getClient(), repository); } catch (Exception e) { -- 2.39.5