Files
DIY_GIT_in_Python/how_to/Change_34.md

16 lines
716 B
Markdown

- data: Don't always dereference refs (for `ugit k`)
Actually, it's not always desirable to dereference a ref all the way. Sometimes
we would like to know at which ref a symbolic ref points, rather than the final
OID. Or we would like to update a ref directly, rather then updating the last
ref in the chain.
One such usecase is `ugit k`. When visualizing refs it would be nice to see
which ref points to which ref. We will see another usecase soon.
To accomodate this, we will add a `deref` option to `get_ref`, `iter_refs` and
`update_ref`. If they will be called with `deref=False`, they will work on the
raw value of a ref and not dereference any symbolic refs.
Then we will update `k` to use `deref=False`.