From: Rob Browning Date: Sun, 23 Mar 2014 18:10:01 +0000 (-0500) Subject: git.py: generalize update_ref() to support tags in addition to heads X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=a17037508c12f05e77ce600a1b7e87e5998fa41a;p=packages%2Fb%2Fbup.git git.py: generalize update_ref() to support tags in addition to heads Signed-off-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/bup/git.py b/lib/bup/git.py index 4825a19..d09fc3f 100644 --- a/lib/bup/git.py +++ b/lib/bup/git.py @@ -872,10 +872,11 @@ def rev_parse(committish, repo_dir=None): def update_ref(refname, newval, oldval, repo_dir=None): - """Change the commit pointed to by a branch.""" + """Update a repository reference.""" if not oldval: oldval = '' - assert(refname.startswith('refs/heads/')) + 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))