Merge branch 'js/reset-usage' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 28 Oct 2016 16:01:22 +0000 (09:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Oct 2016 16:01:22 +0000 (09:01 -0700)
Message fix-up.

* js/reset-usage:
reset: fix usage

1  2 
builtin/reset.c
diff --combined builtin/reset.c
index 9020ec66c81de0185244d478e588d4a05c2a4f1d,fdf47285c17ba2602fa5452bbfae029f09a81d52..9400acce070c8870d6aab8b9a4cb361460488fb6
@@@ -24,7 -24,7 +24,7 @@@
  
  static const char * const git_reset_usage[] = {
        N_("git reset [--mixed | --soft | --hard | --merge | --keep] [-q] [<commit>]"),
-       N_("git reset [-q] <tree-ish> [--] <paths>..."),
+       N_("git reset [-q] [<tree-ish>] [--] <paths>..."),
        N_("git reset --patch [<tree-ish>] [--] [<paths>...]"),
        NULL
  };
@@@ -103,7 -103,7 +103,7 @@@ static void print_new_head_line(struct 
        if (body) {
                const char *eol;
                size_t len;
 -              body += 2;
 +              body = skip_blank_lines(body + 2);
                eol = strchr(body, '\n');
                len = eol ? eol - body : strlen(body);
                printf(" %.*s\n", (int) len, body);
@@@ -121,7 -121,7 +121,7 @@@ static void update_index_from_diff(stru
  
        for (i = 0; i < q->nr; i++) {
                struct diff_filespec *one = q->queue[i]->one;
 -              int is_missing = !(one->mode && !is_null_sha1(one->sha1));
 +              int is_missing = !(one->mode && !is_null_oid(&one->oid));
                struct cache_entry *ce;
  
                if (is_missing && !intent_to_add) {
                        continue;
                }
  
 -              ce = make_cache_entry(one->mode, one->sha1, one->path,
 +              ce = make_cache_entry(one->mode, one->oid.hash, one->path,
                                      0, 0);
                if (!ce)
                        die(_("make_cache_entry failed for path '%s'"),
@@@ -158,7 -158,7 +158,7 @@@ static int read_from_tree(const struct 
                return 1;
        diffcore_std(&opt);
        diff_flush(&opt);
 -      free_pathspec(&opt.pathspec);
 +      clear_pathspec(&opt.pathspec);
  
        return 0;
  }