Support "repo init -b foo && repo sync" to switch baselines
We now correctly support re-initializing an existing client to point
to a different branch of the same manifest repository, effectively
allowing the client to switch the baseline it is operating on.
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/subcmds/init.py b/subcmds/init.py
index 4f99430..937296b 100644
--- a/subcmds/init.py
+++ b/subcmds/init.py
@@ -126,7 +126,8 @@
m.Sync_NetworkHalf()
m.Sync_LocalHalf()
- m.StartBranch('default')
+ if is_new:
+ m.StartBranch('default')
def _LinkManifest(self, name):
if not name: