Code

Merge branch 'js/add-e-submodule-fix'
authorJunio C Hamano <gitster@pobox.com>
Fri, 10 Feb 2012 22:08:27 +0000 (14:08 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 10 Feb 2012 22:08:27 +0000 (14:08 -0800)
* js/add-e-submodule-fix:
  add -e: do not show difference in a submodule that is merely dirty

1  2 
builtin/add.c

diff --combined builtin/add.c
index 1c42900ff8c55a94ccfd1d214567d0f64d615412,68fd050e94586b15ac720e415f8026ef2f62f7d1..b79336d712b4c71cc2f026b0e9f42ea0bcebfc6f
@@@ -13,7 -13,6 +13,7 @@@
  #include "diff.h"
  #include "diffcore.h"
  #include "revision.h"
 +#include "bulk-checkin.h"
  
  static const char * const builtin_add_usage[] = {
        "git add [options] [--] <filepattern>...",
@@@ -280,6 -279,7 +280,7 @@@ static int edit_patch(int argc, const c
  
        argc = setup_revisions(argc, argv, &rev, NULL);
        rev.diffopt.output_format = DIFF_FORMAT_PATCH;
+       DIFF_OPT_SET(&rev.diffopt, IGNORE_DIRTY_SUBMODULES);
        out = open(file, O_CREAT | O_WRONLY, 0644);
        if (out < 0)
                die (_("Could not open '%s' for writing."), file);
@@@ -459,15 -459,11 +460,15 @@@ int cmd_add(int argc, const char **argv
                free(seen);
        }
  
 +      plug_bulk_checkin();
 +
        exit_status |= add_files_to_cache(prefix, pathspec, flags);
  
        if (add_new_files)
                exit_status |= add_files(&dir, flags);
  
 +      unplug_bulk_checkin();
 +
   finish:
        if (active_cache_changed) {
                if (write_cache(newfd, active_cache, active_nr) ||