Remove unnecessary parameter "bare"
authorLin Yang <lin.a.yang@intel.com>
Thu, 22 Aug 2013 08:22:03 +0000 (16:22 +0800)
committerEduard Bartosh <eduard.bartosh@intel.com>
Thu, 22 Aug 2013 10:51:34 +0000 (03:51 -0700)
When update local git cached repo, it should check whether local repo is bare,
not depend on the parameter.

Change-Id: I4370b039e399e9cb9796d0fbd503888f5488c552
Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Reviewed-on: https://otctools.jf.intel.com/review/6068
Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
Reviewed-by: Eduard Bartosh <eduard.bartosh@intel.com>
common/git.py

index d670368..207dd30 100644 (file)
@@ -80,13 +80,13 @@ class Git(GitRepository):
         else:
             return None
 
-def _update_gitproject(localdir, gitpath=None, bare=False):
+def _update_gitproject(localdir, gitpath=None):
     """Fetch latest code to local dir"""
 
     print '\nUpdating local git: %s' % localdir
     try:
         localgit = Git(localdir)
-        if not bare:
+        if not localgit.bare:
             localgit.pull(repo=gitpath, all_repos=True)
         localgit.fetch(repo=gitpath, tags=True, all_remotes=True)
     except GitRepositoryError, gre:
@@ -103,8 +103,7 @@ def _clone_gitproject(giturl, gerritprj, localdir, bare=False):
 
     # fetch latest code if local dir already exists
     if os.path.isdir(localdir) and \
-            _update_gitproject(localdir, gitpath="%s/%s" %(giturl,gerritprj),
-                               bare=bare):
+            _update_gitproject(localdir, gitpath="%s/%s" %(giturl,gerritprj)):
         return True
 
     try: