git index implementation in pure js