summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2014-04-17 20:04:56 -0400
committerJames Moger <james.moger@gitblit.com>2014-04-17 20:04:56 -0400
commitf8c5ca9ca38908124e419e2ff5bb77b3799e54c9 (patch)
treea679b51b18684b10adf3d72af8997e3ba7a5cbc6
parent3a649921c7772abf1414eca08276ab18beac9bcc (diff)
downloadgitblit-f8c5ca9ca38908124e419e2ff5bb77b3799e54c9.tar.gz
gitblit-f8c5ca9ca38908124e419e2ff5bb77b3799e54c9.zip
Strip leading / from a repository name on ssh fetch/push
-rw-r--r--src/main/java/com/gitblit/transport/ssh/git/BaseGitCommand.java5
1 files 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) {