replace: allow long option names
[gitweb.git] / builtin / rm.c
index 694568a0e5058c7d3bdad852238f740069a085c5..0df0b4d942c09769ff42539f6aaf83dcc31e20fb 100644 (file)
@@ -51,7 +51,8 @@ static void print_error_files(struct string_list *files_list,
                        strbuf_addf(&err_msg,
                                    "\n    %s",
                                    files_list->items[i].string);
-               strbuf_addstr(&err_msg, hints_msg);
+               if (advice_rm_hints)
+                       strbuf_addstr(&err_msg, hints_msg);
                *errs = error("%s", err_msg.buf);
                strbuf_release(&err_msg);
        }
@@ -81,7 +82,7 @@ static int check_submodules_use_gitfiles(void)
        for (i = 0; i < list.nr; i++) {
                const char *name = list.entry[i].name;
                int pos;
-               struct cache_entry *ce;
+               const struct cache_entry *ce;
                struct stat st;
 
                pos = cache_name_pos(name, strlen(name));
@@ -126,7 +127,7 @@ static int check_local_mod(unsigned char *head, int index_only)
        for (i = 0; i < list.nr; i++) {
                struct stat st;
                int pos;
-               struct cache_entry *ce;
+               const struct cache_entry *ce;
                const char *name = list.entry[i].name;
                unsigned char sha1[20];
                unsigned mode;
@@ -319,7 +320,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
        seen = xcalloc(i, 1);
 
        for (i = 0; i < active_nr; i++) {
-               struct cache_entry *ce = active_cache[i];
+               const struct cache_entry *ce = active_cache[i];
                if (!match_pathspec(pathspec, ce->name, ce_namelen(ce), 0, seen))
                        continue;
                ALLOC_GROW(list.entry, list.nr + 1, list.alloc);