From: Junio C Hamano Date: Mon, 2 May 2005 06:50:51 +0000 (-0700) Subject: Implement git-update-cache --force-remove X-Git-Tag: v0.99~655^2~1 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0ff5bf7cfcb20a6c2404fe7b9cc6ff18e47db812;p=git.git Implement git-update-cache --force-remove This new flag tells git-update-cache to remove the named path even when the work tree still happens to have the file. It is used to update git-merge-one-file-script not to smudge the work tree. Signed-off-by: Junio C Hamano --- diff --git a/update-cache.c b/update-cache.c index 0401372e4..bb25fa114 100644 --- a/update-cache.c +++ b/update-cache.c @@ -306,6 +306,15 @@ int main(int argc, char **argv) i += 3; continue; } + if (!strcmp(path, "--force-remove")) { + if (argc <= i + 1) + die("update-cache: --force-remove "); + if (remove_file_from_cache(argv[i+1])) + die("update-cache: --force-remove cannot remove %s", argv[i+1]); + i++; + continue; + } + if (!strcmp(path, "--ignore-missing")) { not_new = 1; continue;