Merge branch 'os/commit-submodule-ignore'
authorJunio C Hamano <gitster@pobox.com>
Mon, 1 Oct 2012 19:58:51 +0000 (12:58 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Oct 2012 19:58:52 +0000 (12:58 -0700)
"git status" honored the ignore=dirty settings in .gitmodules but
"git commit" didn't.

* os/commit-submodule-ignore:
commit: pay attention to submodule.$name.ignore in .gitmodules

1  2 
builtin/commit.c
index 4d50484837ece50276ca7a09239815dcca5b5f7d,3cb1ef73ad2fe9977c90bb76dbe0ff96b10d3cde..a17a5df4494e9414bd4b04fd008671d84d914ca0
@@@ -1412,30 -1253,24 +1412,31 @@@ int cmd_commit(int argc, const char **a
        struct commit_list *parents = NULL, **pptr = &parents;
        struct stat statbuf;
        int allow_fast_forward = 1;
 -      struct wt_status s;
 +      struct commit *current_head = NULL;
 +      struct commit_extra_header *extra = NULL;
 +
 +      if (argc == 2 && !strcmp(argv[1], "-h"))
 +              usage_with_options(builtin_commit_usage, builtin_commit_options);
  
        wt_status_prepare(&s);
+       gitmodules_config();
        git_config(git_commit_config, &s);
 -      in_merge = file_exists(git_path("MERGE_HEAD"));
 -      s.in_merge = in_merge;
 -
 -      if (s.use_color == -1)
 -              s.use_color = git_use_color_default;
 -      argc = parse_and_validate_options(argc, argv, builtin_commit_usage,
 -                                        prefix, &s);
 -      if (dry_run) {
 -              if (diff_use_color_default == -1)
 -                      diff_use_color_default = git_use_color_default;
 -              return dry_run_commit(argc, argv, prefix, &s);
 +      determine_whence(&s);
 +      s.colopts = 0;
 +
 +      if (get_sha1("HEAD", sha1))
 +              current_head = NULL;
 +      else {
 +              current_head = lookup_commit_or_die(sha1, "HEAD");
 +              if (!current_head || parse_commit(current_head))
 +                      die(_("could not parse HEAD commit"));
        }
 -      index_file = prepare_index(argc, argv, prefix, 0);
 +      argc = parse_and_validate_options(argc, argv, builtin_commit_options,
 +                                        builtin_commit_usage,
 +                                        prefix, current_head, &s);
 +      if (dry_run)
 +              return dry_run_commit(argc, argv, prefix, current_head, &s);
 +      index_file = prepare_index(argc, argv, prefix, current_head, 0);
  
        /* Set up everything for writing the commit object.  This includes
           running hooks, writing the trees, and interacting with the user.  */