Skip to content

Commit

Permalink
update head with binary sha
Browse files Browse the repository at this point in the history
  • Loading branch information
richardjennings committed Jan 14, 2024
1 parent 88034ef commit e0aeccc
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/mygit/refs/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ func CreateBranch(name string) error {
if err != nil {
return err
}
return UpdateHead(name, head)
sha := make([]byte, 20)
if _, err := hex.Decode(sha, head); err != nil {
return err
}
return UpdateHead(name, sha)
}

func DeleteBranch(name string) error {
Expand Down

0 comments on commit e0aeccc

Please sign in to comment.