diff options
Diffstat (limited to 'git_taskrepo/sub_commands')
-rw-r--r-- | git_taskrepo/sub_commands/cmd_init.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/git_taskrepo/sub_commands/cmd_init.py b/git_taskrepo/sub_commands/cmd_init.py index 2a2ea27..f866a7f 100644 --- a/git_taskrepo/sub_commands/cmd_init.py +++ b/git_taskrepo/sub_commands/cmd_init.py @@ -71,21 +71,24 @@ class Init(Command): cur.execute("INSERT INTO config(origin) VALUES (?)", (remote,)) index = self.repo.index + is_dirty = False # Add taskrepo.db to .gitignore gitignore = "%s/.gitignore" % self.repo.working_tree_dir if update_file(gitignore, "taskrepo.db"): print(" - Added taskrepo.db to .gitignore") index.add([gitignore]) + is_dirty = True # Add testinfo.desc to .gitignore gitignore = "%s/.gitignore" % self.repo.working_tree_dir if update_file(gitignore, "testinfo.desc"): print(" - Added testinfo.desc to .gitignore") index.add([gitignore]) + is_dirty = True # if we updated the repo then commit it - if self.repo.is_dirty(working_tree=False): + if is_dirty: assert index.commit("Initialized to use git taskrepo.").type == 'commit' print(" - committed to git") |