GRun('repack', '-a', '-d', '-f').run()
def apply_patch(filename = None, diff = None, base = None,
- fail_dump = True):
+ fail_dump = True, reject = False):
"""Apply a patch onto the current or given index. There must not
be any local changes in the tree, otherwise the command fails
"""
else:
refresh_index()
+ cmd = ['apply', '--index']
+ if reject:
+ cmd += ['--reject']
try:
- GRun('apply', '--index').raw_input(diff).no_output()
+ GRun(*cmd).raw_input(diff).no_output()
except GitRunException:
if base:
switch(orig_head)