Merge branch 'maint-1.7.3' into maint-1.7.4
authorJunio C Hamano <gitster@pobox.com>
Wed, 26 Oct 2011 23:08:08 +0000 (16:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Oct 2011 23:08:08 +0000 (16:08 -0700)
* maint-1.7.3:
make the sample pre-commit hook script reject names with newlines, too
Reindent closing bracket using tab instead of spaces
Documentation/git-update-index: refer to 'ls-files'

1  2 
wt-status.c
diff --combined wt-status.c
index 123582b6cbdff90f4665fbf8db2c92d701680e4d,e0a3260566e50248bb59fdba9c9e53c43b46390f..35020776b6fd4a4d1c585b2037dc193acf4e442d
@@@ -21,15 -21,11 +21,15 @@@ static char default_wt_status_colors[][
        GIT_COLOR_RED,    /* WT_STATUS_UNMERGED */
        GIT_COLOR_GREEN,  /* WT_STATUS_LOCAL_BRANCH */
        GIT_COLOR_RED,    /* WT_STATUS_REMOTE_BRANCH */
 +      GIT_COLOR_NIL,    /* WT_STATUS_ONBRANCH */
  };
  
  static const char *color(int slot, struct wt_status *s)
  {
 -      return s->use_color > 0 ? s->color_palette[slot] : "";
 +      const char *c = s->use_color > 0 ? s->color_palette[slot] : "";
 +      if (slot == WT_STATUS_ONBRANCH && color_is_nil(c))
 +              c = s->color_palette[WT_STATUS_HEADER];
 +      return c;
  }
  
  void wt_status_prepare(struct wt_status *s)
@@@ -92,7 -88,7 +92,7 @@@ static void wt_status_print_dirty_heade
  {
        const char *c = color(WT_STATUS_HEADER, s);
  
 -      color_fprintf_ln(s->fp, c, "# Changed but not updated:");
 +      color_fprintf_ln(s->fp, c, "# Changes not staged for commit:");
        if (!advice_status_hints)
                return;
        if (!has_deleted)
@@@ -320,7 -316,7 +320,7 @@@ static void wt_status_collect_changes_w
        if (s->ignore_submodule_arg) {
                DIFF_OPT_SET(&rev.diffopt, OVERRIDE_SUBMODULE_CONFIG);
                handle_ignore_submodules_arg(&rev.diffopt, s->ignore_submodule_arg);
-     }
+       }
        rev.diffopt.format_callback = wt_status_collect_changed_cb;
        rev.diffopt.format_callback_data = s;
        rev.prune_data = s->pathspec;
@@@ -629,8 -625,7 +629,8 @@@ static void wt_status_print_tracking(st
  
  void wt_status_print(struct wt_status *s)
  {
 -      const char *branch_color = color(WT_STATUS_HEADER, s);
 +      const char *branch_color = color(WT_STATUS_ONBRANCH, s);
 +      const char *branch_status_color = color(WT_STATUS_HEADER, s);
  
        if (s->branch) {
                const char *on_what = "On branch ";
                        branch_name += 11;
                else if (!strcmp(branch_name, "HEAD")) {
                        branch_name = "";
 -                      branch_color = color(WT_STATUS_NOBRANCH, s);
 +                      branch_status_color = color(WT_STATUS_NOBRANCH, s);
                        on_what = "Not currently on any branch.";
                }
                color_fprintf(s->fp, color(WT_STATUS_HEADER, s), "# ");
 -              color_fprintf_ln(s->fp, branch_color, "%s%s", on_what, branch_name);
 +              color_fprintf(s->fp, branch_status_color, "%s", on_what);
 +              color_fprintf_ln(s->fp, branch_color, "%s", branch_name);
                if (!s->is_initial)
                        wt_status_print_tracking(s);
        }