Commit graph

3 commits

Author SHA1 Message Date
Johannes Schindelin 2e7a9785c2 git-reset: do not be confused if there is nothing to reset
The purpose of the function update_index_from_diff() (which is the
callback function we give do_diff_cache()) is to update those index
entries which differ from the given commit.

Since do_diff_cache() plays games with the in-memory index, this function
discarded the cache and reread it.

Then, back in the function read_from_tree() we wrote the index.

Of course, this broke down when there were no changes and
update_index_from_diff() was not called, and therefore the mangled index
was not discarded.

The solution is to move the index writing into the function
update_index_from_diff().

Noticed by Björn Steinbrink.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-03 21:44:57 -07:00
Junio C Hamano cbb390cd8f An additional test for "git-reset -- path"
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-13 20:54:14 -07:00
Carlos Rica 359048d6ec Add tests for documented features of "git reset".
This adds the new file t/t7102-reset.sh following the text
and examples in "Documentation/git-reset.txt" in order to
check the behaviour of the upcoming "builtin-reset.c",
and be able to compare it with the original "git-reset.sh".

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-12 13:25:07 -07:00