Skip to content

Commit

Permalink
Implement git-update-cache --force-remove <path>
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed May 2, 2005
1 parent 74400e7 commit 0ff5bf7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions update-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0ff5bf7

Please sign in to comment.