def update_ref(refname, newval, oldval, repo_dir=None):
 if (not oldval):
  oldval = ''
 assert (refname.startswith('refs/heads/') or refname.startswith('refs/tags/'))
 p = subprocess.Popen(['git', 'update-ref', refname, newval.encode('hex'), oldval.encode('hex')], preexec_fn=_gitenv(repo_dir))
 _git_wait('git update-ref', p)

def update_ref ( refname , newval , oldval , repo_dir = None ) : if ( not oldval ) : oldval = '' assert ( refname . startswith ( 'refs/heads/' ) or refname . startswith ( 'refs/tags/' ) ) p = subprocess . Popen ( [ 'git' , 'update-ref' , refname , newval . encode ( 'hex' ) , oldval . encode ( 'hex' ) ] , preexec_fn = _gitenv ( repo_dir ) ) _git_wait ( 'git update-ref' , p )
update a repository reference .