Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/main/java/pl/project13/maven/git/NativeGitProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,15 @@ protected String getBranchName() throws IOException {
}

private String getBranch(File canonical) {
String branch = tryToRunGitCommand(canonical, "symbolic-ref HEAD");
if (branch != null) {
branch = branch.replace("refs/heads/", "");
String branch = null;
try{
branch = tryToRunGitCommand(canonical, "symbolic-ref HEAD");
if (branch != null) {
branch = branch.replace("refs/heads/", "");
}
}catch(RuntimeException e){
// it seems that git repro is in 'DETACHED HEAD'-State, using Commid-Id as Branch
branch = getCommitId();
}
return branch;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,11 +621,6 @@ public void shouldExtractTagsOnGivenCommit(boolean useNativeGit) throws Exceptio
@Test
@Parameters(method = "useNativeGit")
public void runGitDescribeWithMatchOption(boolean useNativeGit) throws Exception {
if (System.getenv().get("TRAVIS").equals("true") && System.getenv().get("CI").equals("true")) {
// FIXME: this test has trouble on travis, I think it's because of not pulling everything?
return;
}

// given
mavenSandbox.withParentProject("my-pom-project", "pom")
.withChildProject("my-jar-module", "jar")
Expand Down