0

While I can imagine to e.g. delete the tag via Reference.delete and then to recreate it anew (on the other commit), I wonder what the "official" way of moving a tag in pygit2 is.

abergmeier
  • 13,224
  • 13
  • 64
  • 120

1 Answers1

0

The race-free way to change that a reference points to is by setting its target field.

ref.target = tag.id

will make sure it updates the reference, removing a possible race condition with a cleanup process.

Carlos Martín Nieto
  • 5,207
  • 1
  • 15
  • 16