GitOperations now does a reset before pulling latest changes on train update.

This commit is contained in:
Oliver Gierke
2014-05-02 13:20:24 +02:00
parent cabacc002f
commit a04ee8fccc

View File

@@ -113,11 +113,8 @@ public class GitOperations {
update(module.getProject()).get();
String checkoutCommand = String.format("git checkout %s", branch);
String checkoutCommand = String.format("git checkout %s && git pull origin %s", branch, branch);
osCommandOperations.executeCommand(checkoutCommand, module.getProject()).get();
String updateCommand = String.format("git pull origin %s", branch);
osCommandOperations.executeCommand(updateCommand, module.getProject()).get();
}
}
@@ -143,8 +140,8 @@ public class GitOperations {
logger.log(project, "Found existing repository %s. Obtaining latest changes…", repositoryName);
return osCommandOperations.executeCommand("git checkout master && git fetch --tags && git pull origin master",
project);
return osCommandOperations.executeCommand(
"git checkout master && git reset --hard && git fetch --tags && git pull origin master", project);
} else {