From: Alan Knowles Date: Wed, 19 Dec 2018 04:04:07 +0000 (+0800) Subject: GitRepo.vala X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=df7967d0f640ee80ad070016b6a2d1020ed01328 GitRepo.vala --- diff --git a/GitRepo.vala b/GitRepo.vala index 59633f31..936ecd55 100644 --- a/GitRepo.vala +++ b/GitRepo.vala @@ -220,20 +220,10 @@ public class GitRepo : Object { return this.get_config("autocommit") == "1"; } + public void set_autocommit(bool val) { - - var cur = this.is_autocommit(); - GLib.debug("SET auto commit : %s <= %s", val ? "ON" : "OFF", cur ? "ON" : "OFF"); - if (cur == val) { - return; // no change.. - } - if (!val) { - FileUtils.set_contents(this.gitdir + "/.gitlive-disable-autocommit" , "x"); - } else { - // it exists... - FileUtils.remove(this.gitdir + "/.gitlive-disable-autocommit" ); - } + this.set_config("autocommit", val ? "1" : "0"); }