diff options
author | Matthias Sohn | 2011-08-23 21:53:56 +0000 |
---|---|---|
committer | Matthias Sohn | 2011-08-23 21:53:56 +0000 |
commit | 42b3ee7311d8df30722c825490fa721d5092b73d (patch) | |
tree | 34d89a8ca25a7713d580c5b1db151212066a128f | |
parent | d7a5297dcb16b47bf2dfbac3fb65d380531a68da (diff) | |
download | egit-42b3ee7311d8df30722c825490fa721d5092b73d.tar.gz egit-42b3ee7311d8df30722c825490fa721d5092b73d.tar.xz egit-42b3ee7311d8df30722c825490fa721d5092b73d.zip |
"Paste Repository Path" should accept parent folder of git directory
Change-Id: Ia05d1ee9a99bb38976a5b211033d7d2612c0f26e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
-rw-r--r-- | org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java index d4ae6ad513..cf2c6d2fd5 100644 --- a/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java +++ b/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/repository/tree/command/PasteCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 SAP AG. + * Copyright (c) 2010-2011 SAP AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * Mathias Kinzler (SAP AG) - initial implementation + * Matthias Sohn (SAP AG) - imply .git if parent folder is given *******************************************************************************/ package org.eclipse.egit.ui.internal.repository.tree.command; @@ -17,6 +18,7 @@ import org.eclipse.core.commands.ExecutionException; import org.eclipse.egit.ui.Activator; import org.eclipse.egit.ui.UIText; import org.eclipse.egit.ui.internal.repository.tree.RepositoryTreeNode; +import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.RepositoryCache; import org.eclipse.jgit.util.FS; import org.eclipse.osgi.util.NLS; @@ -58,11 +60,14 @@ public class PasteCommand extends } if (!RepositoryCache.FileKey.isGitRepository(file, FS.DETECTED)) { - errorMessage = NLS - .bind( - UIText.RepositoriesView_ClipboardContentNoGitRepoMessage, - content); - return null; + // try if .git folder is one level below + file = new File(file, Constants.DOT_GIT_EXT); + if (!RepositoryCache.FileKey.isGitRepository(file, FS.DETECTED)) { + errorMessage = NLS + .bind(UIText.RepositoriesView_ClipboardContentNoGitRepoMessage, + content); + return null; + } } if (util.addConfiguredRepository(file)) { |