]> asedeno.scripts.mit.edu Git - git.git/blobdiff - builtin-commit.c
cvsexportcommit: Create config option for CVS dir
[git.git] / builtin-commit.c
index a113eb0272438e60ca0af6dff441b9279cd2d133..0baec6db6ac76de81b93f4c990f8347814618be7 100644 (file)
@@ -102,7 +102,7 @@ static struct option builtin_commit_options[] = {
        OPT_BOOLEAN('o', "only", &only, "commit only specified files"),
        OPT_BOOLEAN('n', "no-verify", &no_verify, "bypass pre-commit hook"),
        OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"),
-       OPT_BOOLEAN(0, "untracked-files", &untracked_files, "show all untracked files"),
+       OPT_BOOLEAN('u', "untracked-files", &untracked_files, "show all untracked files"),
        OPT_BOOLEAN(0, "allow-empty", &allow_empty, "ok to record an empty change"),
        OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"),
 
@@ -176,9 +176,11 @@ static void add_remove_files(struct path_list *list)
 {
        int i;
        for (i = 0; i < list->nr; i++) {
+               struct stat st;
                struct path_list_item *p = &(list->items[i]);
-               if (file_exists(p->path))
-                       add_file_to_cache(p->path, 0);
+
+               if (!lstat(p->path, &st))
+                       add_to_cache(p->path, &st, 0);
                else
                        remove_file_from_cache(p->path);
        }