summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-12-18 17:04:10 +1100
committermd_5 <git@md-5.net>2018-12-18 17:04:10 +1100
commit5c6ac9f467ca7671ae335c69b55a6e1704279c07 (patch)
tree7cb732cde699c06f21087d5f59f483e7e1352045 /src/main
parent22a271cf0f91c2e14e6c150f5dece6a61ad517b3 (diff)
downloadbuildtools-5c6ac9f467ca7671ae335c69b55a6e1704279c07.tar
buildtools-5c6ac9f467ca7671ae335c69b55a6e1704279c07.tar.gz
buildtools-5c6ac9f467ca7671ae335c69b55a6e1704279c07.tar.lz
buildtools-5c6ac9f467ca7671ae335c69b55a6e1704279c07.tar.xz
buildtools-5c6ac9f467ca7671ae335c69b55a6e1704279c07.zip
Try and handle "Invalid ref name: origin/master" (how does this happen?)HEADmaster
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/spigotmc/builder/Builder.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/org/spigotmc/builder/Builder.java b/src/main/java/org/spigotmc/builder/Builder.java
index 79fe5e9..9d006d9 100644
--- a/src/main/java/org/spigotmc/builder/Builder.java
+++ b/src/main/java/org/spigotmc/builder/Builder.java
@@ -64,6 +64,7 @@ import org.apache.commons.io.output.TeeOutputStream;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.ResetCommand;
import org.eclipse.jgit.api.errors.GitAPIException;
+import org.eclipse.jgit.api.errors.JGitInternalException;
import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -639,7 +640,14 @@ public class Builder
{
System.out.println( "Pulling updates for " + repo.getRepository().getDirectory() );
- repo.reset().setRef( "origin/master" ).setMode( ResetCommand.ResetType.HARD ).call();
+ try
+ {
+ repo.reset().setRef( "origin/master" ).setMode( ResetCommand.ResetType.HARD ).call();
+ } catch ( JGitInternalException ex )
+ {
+ System.err.println( "*** Warning, could not find origin/master ref, but continuing anyway." );
+ System.err.println( "*** If further errors occur please delete " + repo.getRepository().getDirectory().getParent() + " and retry." );
+ }
repo.fetch().call();
System.out.println( "Successfully fetched updates!" );