]> source.dussan.org Git - jgit.git/commit
Treat CloneCommand.setBranch(null) as setBranch("HEAD") 78/49978/2
authorJonathan Nieder <jrn@google.com>
Wed, 10 Jun 2015 22:43:48 +0000 (15:43 -0700)
committerJonathan Nieder <jrn@google.com>
Thu, 11 Jun 2015 19:03:17 +0000 (12:03 -0700)
commit852963db3b6c58533e36104bf17f8758fd6071dc
treeeb2ff0e4dab42b96c5a3ec6f527b3804eec146df
parentd2ade728a131995c97a65bcb7610b4675682826c
Treat CloneCommand.setBranch(null) as setBranch("HEAD")

This method is documented to take a branch name (not a possibly null
string).  The only way a caller could have set null without either
re-setting to a sane value afterward or producing NullPointerException
was to also call setNoCheckout(true), in which case there would have
been no reason to set the branch in the first place.

Make setBranch(null) request the default behavior (remote's default
branch) instead, imitating C git's clone --no-branch.

Change-Id: I960e7046b8d5b5bc75c7f3688f3a075d3a951b00
Signed-off-by: Jonathan Nieder <jrn@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/api/CloneCommand.java