From e8f75fa3687bfe894a4fa8e59881b7d9170d8a41 Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Fri, 20 Jul 2012 15:32:19 +0100 Subject: [PATCH] Don't delete the branch config when switching branches. The fix for issue #46 in 5d016502ebc6 appears to break syncing in some situations: the branch is deleted after the point where it's been configured, which deletes part of its configuration and causes the config to change each time you call `repo init`, alternating between a configuration that works and one that doesn't. Instead of deleting the branch with git branch -D, use git update-ref -d which just deletes the ref (to avoid the rebase) without touching the configuration for the branch that was set up during the first repo init. This appears to ensure the config is left in a valid state all the time no matter what combination of repo init commands you run, without reintroducing the rebasing issue. Change-Id: Iaadaa6e56a46840bbc593fa5b35cb5b34cd3ce69 --- project.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.py b/project.py index 114ff491..66a123d2 100644 --- a/project.py +++ b/project.py @@ -2181,7 +2181,7 @@ class MetaProject(Project): syncbuf.Finish() return GitCommand(self, - ['branch', '-D', 'default'], + ['update-ref', '-d', 'refs/heads/default'], capture_stdout = True, capture_stderr = True).Wait() == 0