Modify willis to work on branches too

The `willis' utility which reports repo tree status is broken when
operating on branches, because it uses the same git branch to find out
the git tree status. The Manifest object provides proper default
branch for every git repository, that information should be used

   . run modified 'willis' on a ToT, observe reporetd results match
     unmodified version
   . run modified 'willis' in the firmware branch - observe it succeed
     (showing sensible git repos information), it was failing before

Change-Id: I6c96624a3bf6c4f5861b3842cbcce87ff4a7edbf
Signed-off-by: Vadim Bendebury <>
Reviewed-by: David James <>
diff --git a/host/willis b/host/willis
index d0116f2..1d9daf4 100755
--- a/host/willis
+++ b/host/willis
@@ -143,7 +143,7 @@
-def GetBranches(full_name, color):
+def GetBranches(full_name, color, revision):
   """Return a list of branch descriptions."""
   command = ['git', 'branch', '-vv']
@@ -154,7 +154,7 @@
   branches = RunCommand(full_name, command).splitlines()
   # Find out full sha1 of the tracking branch
-  command = ['git', 'rev-parse', 'remotes/m/master']
+  command = ['git', 'rev-parse', revision]
   tracking_sha1 = RunCommand(full_name, command)
   rv = []
@@ -221,7 +221,7 @@
-  branches = GetBranches(full_name, color)
+  branches = GetBranches(full_name, color, project['local_revision'])
   status = GetStatus(full_name)
   text = []