summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2015-02-04 14:21:52 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2015-02-04 14:21:52 +0100
commit21f667edbaa1727e08ea9356fcbfbefdee481b2f (patch)
treec845201e9a152f9828f2e2b265bd873f5c80c0eb /org.eclipse.jgit.pgm
parent23ad3a37638f295e22a67ca16aefeeb53467e289 (diff)
parentfc801dd79f7c6eb3765e4652136f219480478bf6 (diff)
downloadjgit-21f667edbaa1727e08ea9356fcbfbefdee481b2f.tar.gz
jgit-21f667edbaa1727e08ea9356fcbfbefdee481b2f.zip
Merge branch 'stable-3.7'
* stable-3.7: Add option --orphan for checkout Prepare post 3.7.0.201502031740-rc1 builds JGit v3.7.0.201502031740-rc1 Support for the pre-commit hook Fix FileUtils.testRelativize_mixedCase which failed on Mac OS X Add a hook test Introduce hook support into the FS implementations If a pack isn't found on disk remove it from pack list Conflicts: org.eclipse.jgit.java7.test/META-INF/MANIFEST.MF Change-Id: I936acd24d47b911fa30ab29856094e1b2c6ac3db Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties1
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java9
2 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
index 8a77bf928a..2806f91463 100644
--- a/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
+++ b/org.eclipse.jgit.pgm/resources/org/eclipse/jgit/pgm/internal/CLIText.properties
@@ -345,3 +345,4 @@ usage_updateRemoteRefsFromAnotherRepository=Update remote refs from another repo
usage_useNameInsteadOfOriginToTrackUpstream=use <name> instead of 'origin' to track upstream
usage_checkoutBranchAfterClone=checkout named branch instead of remotes's HEAD
usage_viewCommitHistory=View commit history
+usage_orphan=Create a new orphan branch. The first commit made on this new branch will have no parents amd it will be the root of a new history totally disconnected from other branches and commits. \ No newline at end of file
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
index 8f911fd924..56d4fcff02 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Checkout.java
@@ -71,6 +71,9 @@ class Checkout extends TextBuiltin {
@Option(name = "--force", aliases = { "-f" }, usage = "usage_forceCheckout")
private boolean force = false;
+ @Option(name = "--orphan", usage = "usage_orphan")
+ private boolean orphan = false;
+
@Argument(required = true, index = 0, metaVar = "metaVar_name", usage = "usage_checkout")
private String name;
@@ -95,6 +98,7 @@ class Checkout extends TextBuiltin {
command.setCreateBranch(createBranch);
command.setName(name);
command.setForce(force);
+ command.setOrphan(orphan);
}
try {
String oldBranch = db.getBranch();
@@ -107,10 +111,9 @@ class Checkout extends TextBuiltin {
name));
return;
}
- if (createBranch)
+ if (createBranch || orphan)
outw.println(MessageFormat.format(
- CLIText.get().switchedToNewBranch,
- Repository.shortenRefName(ref.getName())));
+ CLIText.get().switchedToNewBranch, name));
else
outw.println(MessageFormat.format(
CLIText.get().switchedToBranch,