Fetch revision and checkout FETCH_HEAD

Fetching revision specified by manifest and checkout FETCH_HEAD.

Change-Id: I47f36d9555625c92d374442ee505c3c0246fb1a0
diff --git a/fetch_externals.py b/fetch_externals.py
index 0be9cc3..2cc7960 100755
--- a/fetch_externals.py
+++ b/fetch_externals.py
@@ -45,7 +45,7 @@
 ###############################################################################
 
 class Git(object):
-    def __init__(self, pwd, path, name, fetchurl, pushurl=None, revision='origin/master'):
+    def __init__(self, pwd, path, name, fetchurl, pushurl=None, revision='master'):
         self.pwd = pwd
         self.path = path
         self.name = name
@@ -57,8 +57,8 @@
     def checkout_and_update(self):
         self.init()
         self.remote_add(self.name, self.revision, self.fetchurl, self.pushurl)
-        self.fetch(self.name)
-        self.checkout(self.name, self.revision)
+        self.fetch(self.name, self.revision)
+        self.checkout(self.name, 'FETCH_HEAD')
 
     def init(self):
         if not os.path.exists(self.absolutepath):
@@ -82,8 +82,8 @@
             if pushurl:
                 check_output(['git', 'remote', 'set-url', '--add', '--push', name, pushurl], cwd=self.absolutepath)
 
-    def fetch(self, name):
-        check_output(['git', 'fetch', name], cwd=self.absolutepath)
+    def fetch(self, name, revision):
+        check_output(['git', 'fetch', name, revision], cwd=self.absolutepath)
 
     def checkout(self, name, revision):
         rev = self.__get_rev(name, revision)