Skip to content

Commit

Permalink
bug #3994 Issue with tests in hop-plugins-misc-git on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gvdutra committed Aug 19, 2024
1 parent e193809 commit 11a008d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/misc/git/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<name>Hop Plugins Miscellaneous Git</name>

<properties>
<dependency.jgit.revision>6.7.0.202309050840-r</dependency.jgit.revision>
<dependency.jgit.revision>6.10.0.202406032230-r</dependency.jgit.revision>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.io.InputStream;
import java.io.StringWriter;
import java.util.List;
import java.util.Objects;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.hop.git.model.revision.ObjectRevision;
Expand All @@ -50,6 +52,7 @@
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.transport.RemoteConfig;
import org.eclipse.jgit.transport.URIish;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -74,6 +77,21 @@ public void setUp() throws Exception {
db2 = createWorkRepository();
}

@Override
@After
public void tearDown() throws Exception {
this.db.close();
if(!System.getProperty("os.name").contains("Windows")) {
super.tearDown();
} else {
int lastBackslashIndex = uiGit.getDirectory().lastIndexOf('\\');
String updatedPath = uiGit.getDirectory().substring(0, lastBackslashIndex);

File f = new File(updatedPath);
FileUtils.forceDeleteOnExit(f);
}
}

@Test
public void testGetBranch() {
assertEquals("master", uiGit.getBranch());
Expand Down

0 comments on commit 11a008d

Please sign in to comment.