CloneWithCommitMsgHook: Fix HTTP clone command inconsistency
When cloning a project using HTTP schema, the "/a" in the URL was added
only when choosing to clone without the commit hook. Now the URL is the
same in both cases.
Change-Id: I8fc0667f17cea592bd702a0441cba7ca3f762968
(cherry picked from commit d632d6471b42a47877664a5266ba509026538a32)
diff --git a/src/main/java/com/googlesource/gerrit/plugins/download/command/CloneWithCommitMsgHook.java b/src/main/java/com/googlesource/gerrit/plugins/download/command/CloneWithCommitMsgHook.java
index 948215b..02f3394 100644
--- a/src/main/java/com/googlesource/gerrit/plugins/download/command/CloneWithCommitMsgHook.java
+++ b/src/main/java/com/googlesource/gerrit/plugins/download/command/CloneWithCommitMsgHook.java
@@ -82,18 +82,15 @@
}
if (scheme instanceof HttpScheme || scheme instanceof AnonymousHttpScheme) {
- String host = getHttpHost(scheme, project);
return new StringBuilder()
- .append("git clone ")
- .append(host)
- .append(project)
+ .append(super.getCommand(scheme, project))
.append(" && (cd ")
.append(projectName)
.append(" && curl -kLo")
.append(TARGET)
.append(HOOK)
.append(" ")
- .append(host)
+ .append(getHttpHost(scheme, project))
.append("tools/")
.append(HOOK)
.append("; chmod +x")