Skip to content

Commit 0f7701a

Browse files
committed
Merge pull request #397 from Jonnymcc/python3
Change callback parameter to command to avoid collision
2 parents 9d28846 + a528916 commit 0f7701a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

git.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ def plugin_file(name):
7171
return PLUGIN_DIRECTORY + '/' + name
7272

7373

74-
def do_when(conditional, callback, *args, **kwargs):
74+
def do_when(conditional, command, *args, **kwargs):
7575
if conditional():
76-
return callback(*args, **kwargs)
77-
sublime.set_timeout(functools.partial(do_when, conditional, callback, *args, **kwargs), 50)
76+
return command(*args, **kwargs)
77+
sublime.set_timeout(functools.partial(do_when, conditional, command, *args, **kwargs), 50)
7878

7979

8080
def goto_xy(view, line, col):
@@ -228,7 +228,10 @@ def run_command(self, command, callback=None, show_status=True,
228228
if wait_for_lock and root and os.path.exists(os.path.join(root, '.git', 'index.lock')):
229229
print("waiting for index.lock", command)
230230
do_when(lambda: not os.path.exists(os.path.join(root, '.git', 'index.lock')),
231-
self.run_command, command, callback=callback, show_status=show_status, filter_empty_args=filter_empty_args, no_save=no_save, wait_for_lock=wait_for_lock, **kwargs)
231+
self.run_command, command, callback=callback,
232+
show_status=show_status, filter_empty_args=filter_empty_args,
233+
no_save=no_save, wait_for_lock=wait_for_lock, **kwargs)
234+
return
232235

233236
s = sublime.load_settings("Git.sublime-settings")
234237
if s.get('save_first') and self.active_view() and self.active_view().is_dirty() and not no_save:

0 commit comments

Comments
 (0)