u_boot_pylib: Correct pylint warnings in gitutil

Correct various pylint warnings in this file.

The remaining ones are three functions with too many arguments (R0913
and R0918) and use of global (W0603).

Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/tools/u_boot_pylib/gitutil.py b/tools/u_boot_pylib/gitutil.py
index 3c52cce..cfcfeff 100644
--- a/tools/u_boot_pylib/gitutil.py
+++ b/tools/u_boot_pylib/gitutil.py
@@ -2,6 +2,8 @@
 # Copyright (c) 2011 The Chromium OS Authors.
 #
 
+"""Basic utilities for running the git command-line tool from Python"""
+
 import os
 import sys
 
@@ -22,6 +24,8 @@
         oneline (bool): True to use --oneline, else False
         reverse (bool): True to reverse the log (--reverse)
         count (int or None): Number of commits to list, or None for no limit
+        decorate (bool): True to use --decorate
+
     Return:
         List containing command and arguments to run
     """
@@ -518,9 +522,8 @@
     """
     to = build_email_list(series.get('to'), alias, '--to', warn_on_error)
     if not to:
-        git_config_to = command.output('git', 'config', 'sendemail.to',
-                                       raise_on_error=False)
-        if not git_config_to:
+        if not command.output('git', 'config', 'sendemail.to',
+                              raise_on_error=False):
             print("No recipient.\n"
                   "Please add something like this to a commit\n"
                   "Series-to: Fred Bloggs <f.blogs@napier.co.nz>\n"
@@ -549,9 +552,8 @@
     cmd += args
     if not dry_run:
         command.run(*cmd, capture=False, capture_stderr=False, cwd=cwd)
-    cmdstr = ' '.join([f'"{x}"' if ' ' in x and not '"' in x else x
-                       for x in cmd])
-    return cmdstr
+    return' '.join([f'"{x}"' if ' ' in x and '"' not in x else x
+                    for x in cmd])
 
 
 def lookup_email(lookup_name, alias, warn_on_error=True, level=0):
@@ -720,6 +722,7 @@
 
     Args:
         spec (str): Git commit to show, e.g. 'my-branch~12'
+        git_dir (str): Path to git repository (None to use default)
 
     Returns:
         str: Hash of commit
@@ -762,6 +765,7 @@
 
     Args:
         git_dir (str): Path to git repository (None to use default)
+        work_tree (str): Git worktree to use, or None if none
 
     Return:
         str: List of dirty filenames and state