Browse Source

Merge pull request #21 from xaviershay/force-push

Force push
pull/60/head
Adrian 11 years ago
parent
commit
51174e0e4b
  1. 7
      pom.xml
  2. 1
      src/main/java/com/englishtown/stash/hook/MirrorRepositoryHook.java

7
pom.xml

@ -136,6 +136,13 @@
<build>
<plugins>
<!-- Workaround for AMPS-1112 -->
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-amps-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>maven-stash-plugin</artifactId>

1
src/main/java/com/englishtown/stash/hook/MirrorRepositoryHook.java

@ -128,6 +128,7 @@ public class MirrorRepositoryHook implements AsyncPostReceiveRepositoryHook, Rep
.command("push")
.argument("--prune") // this deletes locally deleted branches
.argument(authenticatedUrl)
.argument("--force") // Canonical repository should always take precedence over mirror
.argument("+refs/heads/*:refs/heads/*") // Only mirror heads
.argument("+refs/tags/*:refs/tags/*") // and tags
.errorHandler(passwordHandler)

Loading…
Cancel
Save