if (lstat(ce->name, &st) < 0) {
if (errno != ENOENT)
- fprintf(stderr, "warning: '%s': %s",
- ce->name, strerror(errno));
+ warning("'%s': %s", ce->name, strerror(errno));
/* It already vanished from the working tree */
continue;
}
* "intent to add" entry.
*/
if (local_changes && staged_changes) {
- if (!index_only || !is_empty_blob_sha1(ce->sha1))
+ if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))
errs = error("'%s' has staged content different "
"from both the file and the HEAD\n"
"(use -f to force removal)", name);
git_config(git_default_config, NULL);
- argc = parse_options(argc, argv, builtin_rm_options, builtin_rm_usage, 0);
+ argc = parse_options(argc, argv, prefix, builtin_rm_options,
+ builtin_rm_usage, 0);
if (!argc)
usage_with_options(builtin_rm_usage, builtin_rm_options);
continue;
}
if (!removed)
- die("git rm: %s: %s", path, strerror(errno));
+ die_errno("git rm: '%s'", path);
}
}