Skip to content
Browse files

Replace uses of deprecated Repository.getRef()

Use Repository.findRef() or Repository.exactRef(), as appropriate. No
functional change.

Change-Id: Ie481c7fa5ac69d4778cf9f70ac2b019bee6e53c9
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
  • Loading branch information...
1 parent 4d42553 commit 118f42f3321c2aa9e98c1e5d388d43950865b877 Thomas Wolf committed May 21, 2016
Showing with 58 additions and 59 deletions.
  1. +2 −2 org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
  2. +9 −12 org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java
  3. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
  4. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java
  5. +3 −2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/InitHandlerTest.java
  6. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushBranchWizardTest.java
  7. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java
  8. +2 −2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java
  9. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
  10. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java
  11. +2 −2 ...e.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
  12. +1 −1 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
  13. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
  14. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
  15. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java
  16. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java
  17. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java
  18. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
  19. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java
  20. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java
  21. +2 −2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/RebaseCurrentRefCommand.java
  22. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java
  23. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java
  24. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
  25. +8 −8 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java
  26. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionAndEditDialog.java
  27. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java
  28. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java
  29. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
  30. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/SimpleConfigurePushDialog.java
  31. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java
  32. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java
  33. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
  34. +1 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java
  35. +2 −1 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/BranchHierarchyNode.java
  36. +1 −1 ...t.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/RepositoriesViewCommandHandler.java
View
4 org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestRepository.java
@@ -310,7 +310,7 @@ public void createBranch(String refName, String newRefName)
throws IOException {
RefUpdate updateRef;
updateRef = repository.updateRef(newRefName);
- Ref startRef = repository.getRef(refName);
+ Ref startRef = repository.findRef(refName);
ObjectId startAt = repository.resolve(refName);
String startBranch;
if (startRef != null)
@@ -462,7 +462,7 @@ public boolean removedFromIndex(String absolutePath) throws IOException {
if (dc == null)
return true;
- Ref ref = repository.getRef(Constants.HEAD);
+ Ref ref = repository.exactRef(Constants.HEAD);
try (RevWalk rw = new RevWalk(repository)) {
RevCommit c = rw.parseCommit(ref.getObjectId());
View
21 org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/RebaseOperationTest.java
@@ -82,9 +82,8 @@ public void testUpToDate() throws Exception {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(
- testRepository.getRepository(), testRepository.getRepository()
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(testRepository.getRepository(),
+ testRepository.getRepository().exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -127,9 +126,8 @@ public void testNoConflict() throws Exception {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(
- testRepository.getRepository(), testRepository.getRepository()
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(testRepository.getRepository(),
+ testRepository.getRepository().exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -172,9 +170,8 @@ public void testStopAndAbortOnConflict() throws Exception {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(
- testRepository.getRepository(), testRepository.getRepository()
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(testRepository.getRepository(),
+ testRepository.getRepository().exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -220,8 +217,8 @@ public void testExceptionWhenRestartingStoppedRebase() throws Exception {
assertEquals(first, topicCommit.getParent(0));
// rebase topic onto master
- RebaseOperation op = new RebaseOperation(repository, repository
- .getRef(MASTER));
+ RebaseOperation op = new RebaseOperation(repository,
+ repository.exactRef(MASTER));
op.execute(null);
RebaseResult res = op.getResult();
@@ -230,7 +227,7 @@ public void testExceptionWhenRestartingStoppedRebase() throws Exception {
try {
// let's try to start again, we should get a wrapped
// WrongRepositoryStateException
- op = new RebaseOperation(repository, repository.getRef(MASTER));
+ op = new RebaseOperation(repository, repository.exactRef(MASTER));
op.execute(null);
fail("Expected Exception not thrown");
} catch (CoreException e) {
View
2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/common/LocalRepositoryTestCase.java
@@ -517,7 +517,7 @@ protected static void createStableBranch(Repository myRepository)
protected static void createBranch(Repository myRepository,
String newRefName) throws IOException {
RefUpdate updateRef = myRepository.updateRef(newRefName);
- Ref sourceBranch = myRepository.getRef("refs/heads/master");
+ Ref sourceBranch = myRepository.exactRef("refs/heads/master");
ObjectId startAt = sourceBranch.getObjectId();
String startBranch = Repository.shortenRefName(sourceBranch.getName());
updateRef.setNewObjectId(startAt);
View
2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/AbstractGitflowHandlerTest.java
@@ -96,7 +96,7 @@ protected void checkoutFeature(String featureName) throws CoreException {
}
protected Ref findBranch(String branchName) throws IOException {
- return repository.getRef(R_HEADS + branchName);
+ return repository.exactRef(R_HEADS + branchName);
}
protected void init() throws CoreException {
View
5 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/gitflow/InitHandlerTest.java
@@ -104,7 +104,7 @@ public void testInitMissingMaster() throws Exception {
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
- assertNotNull(repository.getRef(Constants.R_HEADS + DEVELOP_BRANCH));
+ assertNotNull(repository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH));
}
@Test
@@ -132,7 +132,8 @@ public void testInitEmptyRepoMissingMaster() throws Exception {
assertEquals(HOTFIX_BRANCH_PREFIX, config.getHotfixPrefix());
assertEquals(VERSION_TAG_PREFIX, config.getVersionTagPrefix());
- assertNotNull(localRepository.getRef(Constants.R_HEADS + DEVELOP_BRANCH));
+ assertNotNull(
+ localRepository.exactRef(Constants.R_HEADS + DEVELOP_BRANCH));
}
private void selectProject(String projectName) {
View
2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushBranchWizardTest.java
@@ -248,7 +248,7 @@ private void removeExistingRemotes() throws IOException {
private void checkoutNewLocalBranch(String branchName)
throws Exception {
CreateLocalBranchOperation createBranch = new CreateLocalBranchOperation(
- repository, branchName, repository.getRef("master"),
+ repository, branchName, repository.findRef("master"),
UpstreamConfig.NONE);
createBranch.execute(null);
BranchOperation checkout = new BranchOperation(repository, branchName);
View
2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/push/PushToUpstreamTest.java
@@ -77,7 +77,7 @@ public void pushWithDefaultRemoteWithPushRefSpecs() throws Exception {
private void checkoutNewLocalBranch(String branchName)
throws Exception {
CreateLocalBranchOperation createBranch = new CreateLocalBranchOperation(
- repository, branchName, repository.getRef("master"),
+ repository, branchName, repository.findRef("master"),
UpstreamConfig.NONE);
createBranch.execute(null);
BranchOperation checkout = new BranchOperation(repository, branchName);
View
4 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/submodule/SubmoduleUpdateTest.java
@@ -76,7 +76,7 @@ public void updateSubmodule() throws Exception {
assertNotNull(subRepo);
subRepo.close();
- Ref head = subRepo.getRef(Constants.HEAD);
+ Ref head = subRepo.exactRef(Constants.HEAD);
assertNotNull(head);
assertTrue(head.isSymbolic());
assertEquals(Constants.R_HEADS + Constants.MASTER, head.getLeaf()
@@ -94,7 +94,7 @@ public void updateSubmodule() throws Exception {
TestUtil.joinJobs(JobFamilies.SUBMODULE_UPDATE);
refreshAndWait();
- head = subRepo.getRef(Constants.HEAD);
+ head = subRepo.exactRef(Constants.HEAD);
assertNotNull(head);
assertFalse(head.isSymbolic());
assertEquals(repoHead, head.getObjectId());
View
2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/history/HistoryViewTest.java
@@ -401,7 +401,7 @@ public void testOpenOfDeletedFile() throws Exception {
@Ignore
public void testRebaseAlreadyUpToDate() throws Exception {
Repository repo = lookupRepository(repoFile);
- Ref stable = repo.getRef("stable");
+ Ref stable = repo.findRef("stable");
SWTBotTable table = getHistoryViewTable(PROJ1);
SWTBotTableItem stableItem = getTableItemWithId(table, stable.getObjectId());
View
2 org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/stagview/StagingViewTest.java
@@ -115,7 +115,7 @@ public void testMergeConflict() throws Exception {
git.checkout().setName("master").call();
commitOneFileChange("on master");
- git.merge().include(repository.getRef("side")).call();
+ git.merge().include(repository.findRef("side")).call();
assertEquals(RepositoryState.MERGING, repository.getRepositoryState());
StagingViewTester stagingView = StagingViewTester
View
4 ...i.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewFetchAndPushTest.java
@@ -152,7 +152,7 @@ private void testPushToOrigin(boolean useRemote) throws Exception {
confirmed.close();
assertTrue("Up to date expected", uptodate);
// touch and run again: expect new branch
- String objectIdBefore = repository.getRef(repository.getFullBranch())
+ String objectIdBefore = repository.exactRef(repository.getFullBranch())
.getLeaf().getObjectId().name();
objectIdBefore = objectIdBefore.substring(0, 7);
touchAndSubmit(null);
@@ -236,7 +236,7 @@ private void testFetchFromOrigin(boolean useRemote) throws Exception {
deleteAllProjects();
shareProjects(clonedRepositoryFile2);
- String objid = repository.getRef("refs/heads/master").getTarget()
+ String objid = repository.exactRef("refs/heads/master").getTarget()
.getObjectId().name();
objid = objid.substring(0, 7);
touchAndSubmit(null);
View
2 ...e.egit.ui.test/src/org/eclipse/egit/ui/view/repositories/GitRepositoriesViewTestBase.java
@@ -75,7 +75,7 @@ protected static void createStableBranch(Repository myRepository)
// that we push two branches to remote
String newRefName = "refs/heads/stable";
RefUpdate updateRef = myRepository.updateRef(newRefName);
- Ref sourceBranch = myRepository.getRef("refs/heads/master");
+ Ref sourceBranch = myRepository.exactRef("refs/heads/master");
ObjectId startAt = sourceBranch.getObjectId();
String startBranch = Repository.shortenRefName(sourceBranch.getName());
updateRef.setNewObjectId(startAt);
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CompareUtils.java
@@ -934,7 +934,7 @@ public static void compareHeadWithWorkingTree(Repository repository,
*/
public static ITypedElement getHeadTypedElement(Repository repository, String repoRelativePath) {
try {
- Ref head = repository.getRef(Constants.HEAD);
+ Ref head = repository.exactRef(Constants.HEAD);
if (head == null || head.getObjectId() == null)
// Initial import, not yet a HEAD commit
return new EmptyTypedElement(""); //$NON-NLS-1$
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/MergeActionHandler.java
@@ -143,7 +143,7 @@ public boolean isEnabled() {
public static boolean checkMergeIsPossible(Repository repository, Shell shell) {
String message = null;
try {
- Ref head = repository.getRef(Constants.HEAD);
+ Ref head = repository.exactRef(Constants.HEAD);
if (head == null || !head.isSymbolic())
message = UIText.MergeAction_HeadIsNoBranch;
else if (!repository.getRepositoryState().equals(
View
2 ...lipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PullFromUpstreamActionHandler.java
@@ -50,7 +50,7 @@ public boolean isEnabled() {
|| !fullBranch.startsWith(Constants.R_REFS)) {
return false;
}
- Ref head = repo.getRef(Constants.HEAD);
+ Ref head = repo.exactRef(Constants.HEAD);
if (head == null || head.getObjectId() == null) {
return false;
}
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushActionHandler.java
@@ -60,7 +60,7 @@ public boolean isEnabled() {
if (repository == null) {
return false;
}
- Ref ref = repository.getRef(Constants.HEAD);
+ Ref ref = repository.exactRef(Constants.HEAD);
return ref != null && ref.getObjectId() != null;
} catch (IOException e) {
Activator.handleError(e.getMessage(), e, false);
View
2 ...e.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushUpstreamOrBranchActionHandler.java
@@ -78,7 +78,7 @@ public boolean isEnabled() {
private static Ref getHeadIfSymbolic(Repository repository) {
try {
- Ref head = repository.getRef(Constants.HEAD);
+ Ref head = repository.exactRef(Constants.HEAD);
if (head != null && head.isSymbolic())
return head;
else
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/RepositoryActionHandler.java
@@ -479,7 +479,7 @@ protected String getPreviousPath(Repository repository,
rw.setTreeFilter(filter);
}
- Ref head = repository.getRef(Constants.HEAD);
+ Ref head = repository.exactRef(Constants.HEAD);
if (head == null) {
return result;
}
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/SwitchToMenu.java
@@ -101,7 +101,7 @@ public void widgetSelected(SelectionEvent e) {
ConfigConstants.CONFIG_WORKFLOW_SECTION, null,
ConfigConstants.CONFIG_KEY_DEFBRANCHSTARTPOINT);
try {
- Ref ref = repository.getRef(sourceRef);
+ Ref ref = repository.findRef(sourceRef);
if (ref != null)
BranchOperationUI.createWithRef(repository,
ref.getName()).start();
View
2 ...e.egit.ui/src/org/eclipse/egit/ui/internal/actions/SynchronizeWorkspaceActionHandler.java
@@ -124,7 +124,7 @@ private String getRealBranchName(Repository repo) {
Ref ref;
try {
- ref = repo.getRef(HEAD);
+ ref = repo.exactRef(HEAD);
} catch (IOException e) {
ref = null;
}
View
4 ...pse.egit.ui/src/org/eclipse/egit/ui/internal/commands/shared/RebaseCurrentRefCommand.java
@@ -91,7 +91,7 @@ private void setRef(ExecutionEvent event) throws ExecutionException {
if (rebaseTargetSelectionDialog.open() == IDialogConstants.OK_ID) {
String refName = rebaseTargetSelectionDialog.getRefName();
try {
- ref = repository.getRef(refName);
+ ref = repository.findRef(refName);
} catch (IOException e) {
throw new ExecutionException(e.getMessage(), e);
}
@@ -135,7 +135,7 @@ public static boolean isEnabledForState(Repository repo,
private static boolean hasHead(Repository repo) {
try {
- Ref headRef = repo.getRef(Constants.HEAD);
+ Ref headRef = repo.exactRef(Constants.HEAD);
return headRef != null && headRef.getObjectId() != null;
} catch (IOException e) {
return false;
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/commit/CommitJob.java
@@ -175,7 +175,7 @@ private void pushUpstream(final RevCommit commit, final PushMode pushTo) {
String fullBranch = repository.getFullBranch();
if (fullBranch != null
&& fullBranch.startsWith(Constants.R_HEADS)) {
- Ref ref = repository.getRef(fullBranch);
+ Ref ref = repository.exactRef(fullBranch);
pushWizard = new PushBranchWizard(repository, ref);
} else {
pushWizard = new PushBranchWizard(repository,
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/components/RefSpecPanel.java
@@ -377,7 +377,7 @@ public void setAssistanceData(final Repository localRepo,
Ref HEAD = null;
try {
- HEAD = localDb.getRef(Constants.HEAD);
+ HEAD = localDb.exactRef(Constants.HEAD);
} catch (IOException e) {
Activator.logError("Couldn't read HEAD from local repository", e); //$NON-NLS-1$
}
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/decorators/GitDocument.java
@@ -142,7 +142,7 @@ void populate() throws IOException {
return;
}
} else {
- if (repository.getRef(Constants.HEAD) == null) {
+ if (repository.exactRef(Constants.HEAD) == null) {
// Complain only if not an unborn branch
String msg = NLS.bind(UIText.GitDocument_errorResolveQuickdiff,
new Object[] { baseline, resource, repository });
View
16 ...lipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/AbstractBranchSelectionDialog.java
@@ -368,9 +368,9 @@ public void create() {
/**
* Enables the OK button. No-op in case Dialog#createButtonsForButtonBar has
* been overridden and the button has not been created.
- *
+ *
* @param enabled
- *
+ *
* @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(Composite)
*/
protected void setOkButtonEnabled(boolean enabled) {
@@ -381,7 +381,7 @@ protected void setOkButtonEnabled(boolean enabled) {
/**
* Returns <code>true</code> if the OK button has been created and is
* enabled.
- *
+ *
* @return the OK button's enabled state or <code>false</code> if the button
* has not been created.
*/
@@ -405,17 +405,17 @@ protected boolean markRef(String refName) {
RepositoryTreeNode node;
try {
if (refName.startsWith(Constants.R_HEADS)) {
- Ref ref = repo.getRef(refName);
+ Ref ref = repo.exactRef(refName);
if (ref == null)
return false;
node = new RefNode(localBranches, repo, ref);
} else if (refName.startsWith(Constants.R_REMOTES)) {
- Ref ref = repo.getRef(refName);
+ Ref ref = repo.exactRef(refName);
if (ref == null)
return false;
node = new RefNode(remoteBranches, repo, ref);
} else if (Constants.HEAD.equals(refName)) {
- Ref ref = repo.getRef(refName);
+ Ref ref = repo.exactRef(refName);
if (ref == null)
return false;
node = new AdditionalRefNode(references, repo, ref);
@@ -424,13 +424,13 @@ protected boolean markRef(String refName) {
.mapCommitToRef(repo, refName, false);
if (mappedRef != null
&& mappedRef.startsWith(Constants.R_REMOTES)) {
- Ref ref = repo.getRef(mappedRef);
+ Ref ref = repo.exactRef(mappedRef);
if (ref == null)
return false;
node = new RefNode(remoteBranches, repo, ref);
} else if (mappedRef != null
&& mappedRef.startsWith(Constants.R_TAGS)) {
- Ref ref = repo.getRef(mappedRef);
+ Ref ref = repo.exactRef(mappedRef);
if (ref == null)
return false;
node = new TagNode(tags, repo, ref);
View
2 ...clipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/BranchSelectionAndEditDialog.java
@@ -175,7 +175,7 @@ public void widgetSelected(SelectionEvent e) {
ConfigConstants.CONFIG_WORKFLOW_SECTION, null,
ConfigConstants.CONFIG_KEY_DEFBRANCHSTARTPOINT);
try {
- Ref ref = repo.getRef(sourceRef);
+ Ref ref = repo.findRef(sourceRef);
if (ref != null) {
base = ref.getName();
}
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/fetch/SimpleConfigureFetchDialog.java
@@ -596,7 +596,7 @@ private void doPaste() {
Ref source;
try {
// TODO better checks for wild-cards and such
- source = repository.getRef(spec.getDestination());
+ source = repository.findRef(spec.getDestination());
} catch (IOException e1) {
source = null;
}
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/history/HistoryPageInput.java
@@ -146,7 +146,7 @@ public boolean isSingleFile() {
*/
public Ref getHead() {
try {
- Ref h = repo.getRef(Constants.HEAD);
+ Ref h = repo.exactRef(Constants.HEAD);
if (h != null && h.isSymbolic())
return h;
return null;
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/PushToGerritPage.java
@@ -470,7 +470,7 @@ private String setTopicInRef(String ref, String topic) {
void doPush() {
try {
URIish uri = new URIish(uriCombo.getText());
- Ref currentHead = repository.getRef(Constants.HEAD);
+ Ref currentHead = repository.exactRef(Constants.HEAD);
String ref = prefixCombo.getItem(prefixCombo.getSelectionIndex())
+ branchText.getText().trim();
if (topicText.isEnabled()) {
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/push/SimpleConfigurePushDialog.java
@@ -673,7 +673,7 @@ private void doPaste() {
Ref source;
try {
// TODO better checks for wild-cards and such
- source = repository.getRef(spec.getSource());
+ source = repository.findRef(spec.getSource());
} catch (IOException e1) {
source = null;
}
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchPage.java
@@ -396,7 +396,7 @@ public void createBranch(String newRefName, boolean checkoutNewBranch,
myBaseCommit);
else
cbop = new CreateLocalBranchOperation(myRepository, newRefName,
- myRepository.getRef(this.sourceRefName),
+ myRepository.findRef(this.sourceRefName),
upstreamConfig);
cbop.execute(monitor);
View
2 org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/CreateBranchWizard.java
@@ -60,7 +60,7 @@ public CreateBranchWizard(Repository repository, String base) {
if (base.startsWith(Constants.R_HEADS)
|| base.startsWith(Constants.R_REMOTES)
|| base.startsWith(Constants.R_TAGS)) {
- Ref currentBranch = repository.getRef(base);
+ Ref currentBranch = repository.exactRef(base);
myPage = new CreateBranchPage(repository, currentBranch);
} else {
// the page only knows some special Refs
View
2 ....egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewContentProvider.java
@@ -645,7 +645,7 @@ private boolean hasConfiguredSubmodules(final Repository repository) {
*/
private boolean hasStashedCommits(final Repository repository) {
try {
- return repository.getRef(Constants.R_STASH) != null;
+ return repository.exactRef(Constants.R_STASH) != null;
} catch (IOException e) {
return false;
}
View
2 ...se.egit.ui/src/org/eclipse/egit/ui/internal/repository/RepositoriesViewLabelProvider.java
@@ -288,7 +288,7 @@ protected StyledString getStyledTextForSubmodule(RepositoryTreeNode node) {
Ref head;
try {
- head = repository.getRef(Constants.HEAD);
+ head = repository.exactRef(Constants.HEAD);
} catch (IOException e) {
return string;
}
View
3 ...eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/BranchHierarchyNode.java
@@ -73,7 +73,8 @@ public BranchHierarchyNode(RepositoryTreeNode parent,
int segmentDiff = myPath.segmentCount()
- getObject().segmentCount();
if (segmentDiff == 1) {
- Ref ref = getRepository().getRef(myPath.toPortableString());
+ Ref ref = getRepository()
+ .findRef(myPath.toPortableString());
childRefs.add(ref);
}
}
View
2 .../org/eclipse/egit/ui/internal/repository/tree/command/RepositoriesViewCommandHandler.java
@@ -106,7 +106,7 @@ public Shell getActiveShell(ExecutionEvent event) throws ExecutionException {
private boolean repositoryHasHead(T treeNode) {
Repository repo = treeNode.getRepository();
try {
- Ref ref = repo.getRef(Constants.HEAD);
+ Ref ref = repo.exactRef(Constants.HEAD);
return ref != null && ref.getObjectId() != null;
} catch (IOException e) {
// ignore and report false

0 comments on commit 118f42f

Please sign in to comment.
Something went wrong with that request. Please try again.