diff --git a/git/__init__.py b/git/__init__.py index bc0f843..2a5b19d 100644 --- a/git/__init__.py +++ b/git/__init__.py @@ -273,20 +273,16 @@ def run_command(self, command, callback=None, show_status=True, filter_empty_arg ): self.active_view().run_command('save') if command[0] == 'git': - if command[1] == 'flow' and s.get('git_flow_command'): - command[0] = s.get('git_flow_command') + if command[1] == 'flow' and (self.active_view().settings().get('git_flow_command') if self.active_view() else s.get('git_flow_command')): + command[0] = self.active_view().settings().get('git_flow_command') if self.active_view() else s.get('git_flow_command') del(command[1]) else: - us = sublime.load_settings('Preferences.sublime-settings') - if s.get('git_command') or us.get('git_binary'): - command[0] = s.get('git_command') or us.get('git_binary') - elif GIT: - command[0] = GIT - if command[0] == 'gitk' and s.get('gitk_command'): - if s.get('gitk_command'): - command[0] = s.get('gitk_command') - elif GITK: - command[0] = GITK + command[0] = ( \ + (self.active_view().settings().get('git_command') or self.active_view().settings().get('git_binary')) if self.active_view() else \ + (s.get('git_command') or sublime.load_settings('Preferences.sublime-settings').get('git_binary')) \ + ) or GIT + if command[0] == 'gitk' and (self.active_view().settings().get('gitk_command') if self.active_view() else s.get('gitk_command')): + command[0] = (self.active_view().settings().get('gitk_command') if self.active_view() else s.get('gitk_command')) or GITK if not callback: callback = self.generic_done