From: Rob Browning Date: Sun, 23 Mar 2014 18:07:25 +0000 (-0500) Subject: git.py: allow the specification of a repo_dir to update_ref() X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=33d395fd4ab47aa3b4aa9094e5b220c519d6fc3f;p=packages%2Fb%2Fbup.git git.py: allow the specification of a repo_dir to update_ref() Signed-off-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/bup/git.py b/lib/bup/git.py index 543d55d..4825a19 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -871,14 +871,14 @@ def rev_parse(committish, repo_dir=None): return None -def update_ref(refname, newval, oldval): +def update_ref(refname, newval, oldval, repo_dir=None): """Change the commit pointed to by a branch.""" if not oldval: oldval = '' assert(refname.startswith('refs/heads/')) p = subprocess.Popen(['git', 'update-ref', refname, newval.encode('hex'), oldval.encode('hex')], - preexec_fn = _gitenv()) + preexec_fn = _gitenv(repo_dir)) _git_wait('git update-ref', p)