Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
- Fixed bug of some Git calls not getting closed which caused irregul…
Browse files Browse the repository at this point in the history
…arities in gear management
  • Loading branch information
MatthewYork committed Nov 25, 2014
1 parent d1b93ba commit 255d27c
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
5 changes: 2 additions & 3 deletions AndroidGears/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions AndroidGears/AndroidGears.iml
Expand Up @@ -7,7 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IDEA IC-135.480" jdkType="IDEA JDK" />
<orderEntry type="jdk" jdkName="IDEA IC-139.225.3" jdkType="IDEA JDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library" exported="">
<library>
Expand All @@ -23,5 +23,4 @@
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
<orderEntry type="library" name="gson-2.2.4" level="project" />
</component>
</module>

</module>
2 changes: 1 addition & 1 deletion AndroidGears/META-INF/plugin.xml
@@ -1,7 +1,7 @@
<idea-plugin version="2">
<id>com.github.androidgears.plugin5</id>
<name>Android Gears</name>
<version>0.4.9</version>
<version>0.5.1</version>
<vendor email="myork@cs.ua.edu" url="http://www.androidgears.org">Android Gears</vendor>

<description><![CDATA[
Expand Down
3 changes: 2 additions & 1 deletion AndroidGears/src/Utilities/GearSpecManager.java
Expand Up @@ -59,11 +59,12 @@ public static Boolean installModule(GearSpec spec, Project project, Module modul

//Clone down repo
try {
Git.cloneRepository()
Git git = Git.cloneRepository()
.setURI(spec.getSource().getUrl())
.setBranch(spec.getSource().getTag())
.setDirectory(specDirectory)
.call();
git.close();
} catch (GitAPIException e) {
e.printStackTrace();

Expand Down
6 changes: 4 additions & 2 deletions AndroidGears/src/Workers/Git/GitWorker.java
Expand Up @@ -53,11 +53,13 @@ private Boolean cloneRepository(File androidGearsDirectory){
//Get repos directory
File reposDirectory = git.getRepository().getDirectory().getParentFile();

//Check that we cloned down correctly
//Close git connection!
git.close();

//If everything was created successfully, return true
if (reposDirectory != null){
if (reposDirectory.exists()){
if (reposDirectory.list().length > 1){
git.close();
return true;
}
}
Expand Down

0 comments on commit 255d27c

Please sign in to comment.