Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHE7856: Fix parsing path when getting Git Status on file creation #7974

Merged
merged 1 commit into from
Dec 22, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.New.FILE;
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.New.NEW;
import static org.eclipse.che.selenium.core.constant.TestMenuCommandsConstants.Project.PROJECT;
import static org.testng.Assert.fail;

import com.google.inject.Inject;
import com.google.inject.name.Named;
Expand All @@ -37,7 +36,6 @@
import org.eclipse.che.selenium.pageobject.git.Git;
import org.eclipse.che.selenium.pageobject.machineperspective.MachineTerminal;
import org.openqa.selenium.Keys;
import org.openqa.selenium.TimeoutException;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

Expand Down Expand Up @@ -151,13 +149,7 @@ public void testNewFileColor() {
askForValueDialog.typeAndWaitText("newFile");
askForValueDialog.clickOkBtn();
askForValueDialog.waitFormToClose();

try {
editor.waitYellowTab("newFile");
} catch (TimeoutException ex) {
// remove try-catch block after issue has been resolved
fail("Known issue https://github.com/eclipse/che/issues/7856", ex);
}
editor.waitYellowTab("newFile");

// check that the file color is yellow
projectExplorer.waitYellowNode(PROJECT_NAME + "/newFile");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import static java.util.Collections.singletonList;
import static org.eclipse.che.api.fs.server.WsPathUtils.SEPARATOR;
import static org.eclipse.che.api.fs.server.WsPathUtils.nameOf;
import static org.eclipse.che.api.fs.server.WsPathUtils.resolve;
import static org.eclipse.che.api.project.server.VcsStatusProvider.VcsStatus.ADDED;
import static org.eclipse.che.api.project.server.VcsStatusProvider.VcsStatus.MODIFIED;
Expand Down Expand Up @@ -66,8 +65,8 @@ public VcsStatus getStatus(String wsPath) throws ServerException {
.getClosest(wsPath)
.orElseThrow(() -> new NotFoundException("Can't find project"));
String projectFsPath = pathTransformer.transform(project.getPath()).toString();
String projectName = nameOf(project.getPath());
String itemPath = wsPath.substring(wsPath.indexOf(projectName + SEPARATOR));
wsPath = wsPath.substring(wsPath.startsWith(SEPARATOR) ? 1 : 0);
String itemPath = wsPath.substring(wsPath.indexOf(SEPARATOR) + 1);
Status status =
gitConnectionFactory.getConnection(projectFsPath).status(singletonList(itemPath));
if (status.getUntracked().contains(itemPath)) {
Expand Down