nicoespeon / gitgraph.js

[ARCHIVED] A JavaScript library to draw pretty git graphs in the browser
https://www.nicoespeon.com/gitgraph.js
MIT License
3.02k stars 363 forks source link

BranchUserApi.checkout() doesn't update the HEAD ref #345

Closed richteambs closed 4 years ago

richteambs commented 4 years ago

After calling mybranch.checkout() the HEAD ref is unaffected. HEAD should always point to the latest commit in the current branch (unless in detached head mode).

To Reproduce

https://codepen.io/richtea43/pen/abOdRzr?editors=0010

Expected behavior

The HEAD ref should always point to the latest commit in the current branch (unless in detached head mode). Anyone using git would expect HEAD to be set after a checkout.

Context

Additional information

The code for commit is here - it doesn't update HEAD. The only time HEAD is updated is when committing (see here).

richtea commented 4 years ago

Apologies, I accidentally used my work account to open this issue - if I have time, I will send a PR from my personal GitGub account (this one).