X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-rm.c;h=b7126e3e25d4f52ae8c4a120d524a24c11129785;hb=0eb5ebc1d862737ea2b313d0d77d120b3d114099;hp=e06640cf8d3418cbbe177b8fdcdccd19e0f3379f;hpb=78a935d48b28ebf5b1af348d7e57763f2955afd1;p=git.git diff --git a/builtin-rm.c b/builtin-rm.c index e06640cf8..b7126e3e2 100644 --- a/builtin-rm.c +++ b/builtin-rm.c @@ -79,7 +79,8 @@ static int check_local_mod(unsigned char *head, int index_only) || 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);