From cced48a808620d60e95a1e51254b135a46ddf719 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Tue, 7 Oct 2008 18:08:21 +0200 Subject: git rm: refresh index before up-to-date check Since "git rm" is supposed to be porcelain, we should convince it to be user friendly by refreshing the index itself. Signed-off-by: Johannes Schindelin Signed-off-by: Shawn O. Pearce --- t/t3600-rm.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 't/t3600-rm.sh') diff --git a/t/t3600-rm.sh b/t/t3600-rm.sh index 558c80edbf..66aca99fd3 100755 --- a/t/t3600-rm.sh +++ b/t/t3600-rm.sh @@ -219,14 +219,23 @@ test_expect_success 'Remove nonexistent file returns nonzero exit status' ' test_expect_success 'Call "rm" from outside the work tree' ' mkdir repo && - cd repo && - git init && - echo something > somefile && - git add somefile && - git commit -m "add a file" && - (cd .. && - git --git-dir=repo/.git --work-tree=repo rm somefile) && - test_must_fail git ls-files --error-unmatch somefile + (cd repo && + git init && + echo something > somefile && + git add somefile && + git commit -m "add a file" && + (cd .. && + git --git-dir=repo/.git --work-tree=repo rm somefile) && + test_must_fail git ls-files --error-unmatch somefile) +' + +test_expect_success 'refresh index before checking if it is up-to-date' ' + + git reset --hard && + test-chmtime -86400 frotz/nitfol && + git rm frotz/nitfol && + test ! -f frotz/nitfol + ' test_done -- cgit v1.2.3