diff --git a/builtin-rm.c b/builtin-rm.c
index e06640cf8d3418cbbe177b8fdcdccd19e0f3379f..b7126e3e25d4f52ae8c4a120d524a24c11129785 100644 (file)
--- a/builtin-rm.c
+++ b/builtin-rm.c
|| hashcmp(ce->sha1, sha1))
staged_changes = 1;
- if (local_changes && staged_changes)
+ if (local_changes && staged_changes &&
+ !(index_only && is_empty_blob_sha1(ce->sha1)))
errs = error("'%s' has staged content different "
"from both the file and the HEAD\n"
"(use -f to force removal)", name);