maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [34/50] [abbrv] git commit: fix checkout of tags
Date Mon, 15 Jul 2013 11:24:45 GMT
fix checkout of tags


Project: http://git-wip-us.apache.org/repos/asf/maven-scm/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-scm/commit/88de6395
Tree: http://git-wip-us.apache.org/repos/asf/maven-scm/tree/88de6395
Diff: http://git-wip-us.apache.org/repos/asf/maven-scm/diff/88de6395

Branch: refs/heads/master
Commit: 88de6395d401cd29186abb635b736d8e86a2f400
Parents: cef38eb
Author: imod <domi@fortysix.ch>
Authored: Fri Jul 12 09:04:56 2013 +0200
Committer: imod <domi@fortysix.ch>
Committed: Fri Jul 12 09:04:56 2013 +0200

----------------------------------------------------------------------
 .../git/jgit/command/checkout/JGitCheckOutCommand.java      | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-scm/blob/88de6395/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
b/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
index 883650e..f8269ab 100644
--- a/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
+++ b/src/main/java/org/apache/maven/scm/provider/git/jgit/command/checkout/JGitCheckOutCommand.java
@@ -147,12 +147,17 @@ public class JGitCheckOutCommand
             }
             
             Set<String> localBranchNames = JGitBranchCommand.getShortLocalBranchNames(git);
-            if(localBranchNames.contains(branch))
+            if(version instanceof ScmTag )
+            {
+            	getLogger().info( "checkout tag [" + branch + "] at " + fileSet.getBasedir()
);
+            	git.checkout().setName(branch).call();
+            }
+            else if(localBranchNames.contains(branch))
             {
             	getLogger().info( "checkout [" + branch + "] at " + fileSet.getBasedir() );
                 git.checkout().setName( branch ).call();
             }
-            else 
+            else
             {
             	getLogger().info( "checkout remote branch [" + branch + "] at " + fileSet.getBasedir()
);
             	git.checkout().setName( branch ).setCreateBranch( true ).setStartPoint( Constants.DEFAULT_REMOTE_NAME
+ "/" + branch ).call();


Mime
View raw message