Author: kevj
Date: Mon Dec 28 08:35:20 2009
New Revision: 894136
URL: http://svn.apache.org/viewvc?rev=894136&view=rev
Log:
-move basic validation here
Modified:
ant/sandbox/antlibs/git/trunk/src/main/org/apache/ant/git/AbstractGitTask.java
Modified:
ant/sandbox/antlibs/git/trunk/src/main/org/apache/ant/git/AbstractGitTask.java
URL:
http://svn.apache.org/viewvc/ant/sandbox/antlibs/git/trunk/src/main/org/apache/ant/git/AbstractGitTask.java?rev=894136&r1=894135&r2=894136&view=diff
==============================================================================
---
ant/sandbox/antlibs/git/trunk/src/main/org/apache/ant/git/AbstractGitTask.java
(original)
+++
ant/sandbox/antlibs/git/trunk/src/main/org/apache/ant/git/AbstractGitTask.java
Mon Dec 28 08:35:20 2009
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
package org.apache.ant.git;
import java.io.BufferedOutputStream;
@@ -341,7 +358,6 @@
* The revision to operate upon.
* @param p revision
*/
-
public void setRevision(String p) {
// Check if not real revision => set it to null
if (p != null && p.trim().length() > 0) {
@@ -553,4 +569,13 @@
}
return false;
}
+
+ protected void validate() throws BuildException {
+ if(null == getGitRepo()) {
+ throw new BuildException("You must specify a gitRepo
value");
+ }
+ if(!validGitRepo()) {
+ throw new BuildException("The repository [ "+
getGitRepo()+ " ] specified is not recognised");
+ }
+ }
}