summaryrefslogtreecommitdiff
path: root/update-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-05-02 06:50:51 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-05-02 06:50:51 (GMT)
commit0ff5bf7cfcb20a6c2404fe7b9cc6ff18e47db812 (patch)
tree84cee1c0d23b36fdaf5d1a4a5785eb6d6f243b87 /update-cache.c
parent74400e7175e3dac994e75452973d78f6a42de65e (diff)
downloadgit-0ff5bf7cfcb20a6c2404fe7b9cc6ff18e47db812.zip
git-0ff5bf7cfcb20a6c2404fe7b9cc6ff18e47db812.tar.gz
git-0ff5bf7cfcb20a6c2404fe7b9cc6ff18e47db812.tar.bz2
Implement git-update-cache --force-remove <path>
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 <junkio@cox.net>
Diffstat (limited to 'update-cache.c')
-rw-r--r--update-cache.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/update-cache.c b/update-cache.c
index 0401372..bb25fa1 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 <path>");
+ 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;