Skip to content

Commit f88cdbc

Browse files
committed
Trivial: improve absorb func dispatch in refresh
Signed-off-by: Peter Grayson <[email protected]>
1 parent 8c4ed4f commit f88cdbc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stgit/commands/refresh.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,11 +297,11 @@ def absorb(stack, patch_name, temp_name, edit_fun, annotate=None):
297297
log_msg = 'refresh'
298298
trans = transaction.StackTransaction(stack, log_msg)
299299
iw = stack.repository.default_iw
300-
f = {
301-
True: absorb_applied,
302-
False: absorb_unapplied
303-
}[patch_name in trans.applied]
304-
if f(trans, iw, patch_name, temp_name, edit_fun):
300+
if patch_name in trans.applied:
301+
absorb_func = absorb_applied
302+
else:
303+
absorb_func = absorb_unapplied
304+
if absorb_func(trans, iw, patch_name, temp_name, edit_fun):
305305
def info_msg():
306306
pass
307307
else:

0 commit comments

Comments
 (0)