usage_mergeStrategy=Use the given merge strategy. Can be supplied more than once to specify them in the order they should be tried. If there is no -s option, the recursive strategy is used. Currently the following strategies are supported: ours, theirs, simple-two-way-in-core, resolve, recursive
usage_moveRenameABranch=move/rename a branch
usage_nameStatus=show only name and status of files
+usage_noCheckoutAfterClone=no checkout of HEAD is performed after the clone is complete
usage_noCommit=Don't commit after a successful merge
usage_noPrefix=do not show any source or destination prefix
usage_noRenames=disable rename detection
@Option(name = "--branch", aliases = { "-b" }, metaVar = "metaVar_branchName", usage = "usage_checkoutBranchAfterClone")
private String branch;
+ @Option(name = "--no-checkout", aliases = { "-n" }, usage = "usage_noCheckoutAfterClone")
+ private boolean noCheckout;
+
@Argument(index = 0, required = true, metaVar = "metaVar_uriish")
private String sourceUri;
saveRemote(uri);
final FetchResult r = runFetch();
- final Ref checkoutRef;
- if (branch == null)
- checkoutRef = guessHEAD(r);
- else {
- checkoutRef = r.getAdvertisedRef(Constants.R_HEADS + branch);
- if (checkoutRef == null)
- throw die(MessageFormat.format(CLIText.get().noSuchRemoteRef,
- branch));
+
+ if (!noCheckout) {
+ final Ref checkoutRef;
+ if (branch == null)
+ checkoutRef = guessHEAD(r);
+ else {
+ checkoutRef = r.getAdvertisedRef(Constants.R_HEADS + branch);
+ if (checkoutRef == null)
+ throw die(MessageFormat.format(
+ CLIText.get().noSuchRemoteRef, branch));
+ }
+ doCheckout(checkoutRef);
}
- doCheckout(checkoutRef);
}
private void saveRemote(final URIish uri) throws URISyntaxException,