From be7c33f2c5ee476190dee369ac5d96809b687612 Mon Sep 17 00:00:00 2001 From: morpheus65535 <5130500+morpheus65535@users.noreply.github.com> Date: Mon, 15 Jan 2018 23:00:29 -0500 Subject: [PATCH] Included git name and email configuration if not already set to avoid update error. --- check_update.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/check_update.py b/check_update.py index e73502a45..fb8005478 100644 --- a/check_update.py +++ b/check_update.py @@ -8,7 +8,23 @@ import git current_working_directory = os.path.dirname(__file__) +def gitconfig(): + g = git.Repo.init(current_working_directory) + config_read = g.config_reader() + config_write = g.config_writer() + + try: + username = config_read.get_value("user", "name") + except: + config_write.set_value("user", "name", "Bazarr") + + try: + email = config_read.get_value("user", "email") + except: + config_write.set_value("user", "email", "bazarr@fake.email") + def check_and_apply_update(): + gitconfig() g = git.cmd.Git(current_working_directory) result = g.pull('origin', branch) if result.startswith('Already'):