@decorator
def git_support(fn, command):
 if (not is_app(command, 'git', 'hub')):
  return False
 if ('trace: alias expansion:' in command.stderr):
  search = re.search('trace: alias expansion: ([^ ]*) => ([^\n]*)', command.stderr)
  alias = search.group(1)
  expansion = ' '.join((shell.quote(part) for part in shell.split_command(search.group(2))))
  new_script = command.script.replace(alias, expansion)
  command = command.update(script=new_script)
 return fn(command)

@ decorator def git_support ( fn , command ) : if ( not is_app ( command , 'git' , 'hub' ) ) : return False if ( 'trace: alias expansion:' in command . stderr ) : search = re . search ( 'trace: alias expansion: ([^ ]*) => ([^\n]*)' , command . stderr ) alias = search . group ( 1 ) expansion = ' ' . join ( ( shell . quote ( part ) for part in shell . split_command ( search . group ( 2 ) ) ) ) new_script = command . script . replace ( alias , expansion ) command = command . update ( script = new_script ) return fn ( command )
resolves git aliases and supports testing for both git and hub .