Merge branch 'maint'
authorShawn O. Pearce <spearce@spearce.org>
Mon, 6 Oct 2008 15:56:07 +0000 (08:56 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Mon, 6 Oct 2008 15:56:07 +0000 (08:56 -0700)
* maint:
Update release notes for 1.6.0.3
Teach rebase -i to honor pre-rebase hook
docs: describe pre-rebase hook
do not segfault if make_cache_entry failed
make prefix_path() never return NULL
fix bogus "diff --git" header from "diff --no-index"
Fix fetch/clone --quiet when stdout is connected
builtin-blame: Fix blame -C -C with submodules.
bash: remove fetch, push, pull dashed form leftovers

Conflicts:
diff.c

1  2 
builtin-blame.c
contrib/completion/git-completion.bash
diff.c
t/t4012-diff-binary.sh
transport.c
diff --combined builtin-blame.c
index 6b7b9f4466989ca02d3a5e53caac9ff5c7e8a922,101c4162dad22db14ac87257b53496ec558137aa..df537593d052f0b4d705eb1d0d19ed296f76a39d
@@@ -464,6 -464,7 +464,6 @@@ struct patch 
  };
  
  struct blame_diff_state {
 -      struct xdiff_emit_state xm;
        struct patch *ret;
        unsigned hunk_post_context;
        unsigned hunk_in_pre_context : 1;
@@@ -526,12 -527,15 +526,12 @@@ static struct patch *compare_buffer(mmf
        xpp.flags = xdl_opts;
        memset(&xecfg, 0, sizeof(xecfg));
        xecfg.ctxlen = context;
 -      ecb.outf = xdiff_outf;
 -      ecb.priv = &state;
        memset(&state, 0, sizeof(state));
 -      state.xm.consume = process_u_diff;
        state.ret = xmalloc(sizeof(struct patch));
        state.ret->chunks = NULL;
        state.ret->num = 0;
  
 -      xdi_diff(file_p, file_o, &xpp, &xecfg, &ecb);
 +      xdi_diff_outf(file_p, file_o, process_u_diff, &state, &xpp, &xecfg, &ecb);
  
        if (state.ret->num) {
                struct chunk *chunk;
@@@ -1132,6 -1136,8 +1132,8 @@@ static int find_copy_in_parent(struct s
  
                        if (!DIFF_FILE_VALID(p->one))
                                continue; /* does not exist in parent */
+                       if (S_ISGITLINK(p->one->mode))
+                               continue; /* ignore git links */
                        if (porigin && !strcmp(p->one->path, porigin->path))
                                /* find_move already dealt with this path */
                                continue;
index 93f088189e6b65e03eddea9013273f0559837d26,751e273e1aeecd382bc584fcb80b2ed6f52ed862..15073d4c9fbccb06e9b17dff4a8d134e805aed6d
@@@ -154,8 -154,11 +154,8 @@@ __git_heads (
  {
        local cmd i is_hash=y dir="$(__gitdir "$1")"
        if [ -d "$dir" ]; then
 -              for i in $(git --git-dir="$dir" \
 -                      for-each-ref --format='%(refname)' \
 -                      refs/heads ); do
 -                      echo "${i#refs/heads/}"
 -              done
 +              git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
 +                      refs/heads
                return
        fi
        for i in $(git ls-remote "$1" 2>/dev/null); do
@@@ -172,8 -175,11 +172,8 @@@ __git_tags (
  {
        local cmd i is_hash=y dir="$(__gitdir "$1")"
        if [ -d "$dir" ]; then
 -              for i in $(git --git-dir="$dir" \
 -                      for-each-ref --format='%(refname)' \
 -                      refs/tags ); do
 -                      echo "${i#refs/tags/}"
 -              done
 +              git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
 +                      refs/tags
                return
        fi
        for i in $(git ls-remote "$1" 2>/dev/null); do
@@@ -191,8 -197,16 +191,8 @@@ __git_refs (
        local cmd i is_hash=y dir="$(__gitdir "$1")"
        if [ -d "$dir" ]; then
                if [ -e "$dir/HEAD" ]; then echo HEAD; fi
 -              for i in $(git --git-dir="$dir" \
 -                      for-each-ref --format='%(refname)' \
 -                      refs/tags refs/heads refs/remotes); do
 -                      case "$i" in
 -                              refs/tags/*)    echo "${i#refs/tags/}" ;;
 -                              refs/heads/*)   echo "${i#refs/heads/}" ;;
 -                              refs/remotes/*) echo "${i#refs/remotes/}" ;;
 -                              *)              echo "$i" ;;
 -                      esac
 -              done
 +              git --git-dir="$dir" for-each-ref --format='%(refname:short)' \
 +                      refs/tags refs/heads refs/remotes
                return
        fi
        for i in $(git ls-remote "$dir" 2>/dev/null); do
@@@ -785,14 -799,9 +785,9 @@@ _git_fetch (
  {
        local cur="${COMP_WORDS[COMP_CWORD]}"
  
-       case "${COMP_WORDS[0]},$COMP_CWORD" in
-       git-fetch*,1)
+       if [ "$COMP_CWORD" = 2 ]; then
                __gitcomp "$(__git_remotes)"
-               ;;
-       git,2)
-               __gitcomp "$(__git_remotes)"
-               ;;
-       *)
+       else
                case "$cur" in
                *:*)
                        local pfx=""
                        __gitcomp "$(__git_refs2 "$remote")"
                        ;;
                esac
-               ;;
-       esac
+       fi
  }
  
  _git_format_patch ()
@@@ -1049,36 -1057,25 +1043,25 @@@ _git_pull (
  {
        local cur="${COMP_WORDS[COMP_CWORD]}"
  
-       case "${COMP_WORDS[0]},$COMP_CWORD" in
-       git-pull*,1)
-               __gitcomp "$(__git_remotes)"
-               ;;
-       git,2)
+       if [ "$COMP_CWORD" = 2 ]; then
                __gitcomp "$(__git_remotes)"
-               ;;
-       *)
+       else
                local remote
                case "${COMP_WORDS[0]}" in
                git-pull)  remote="${COMP_WORDS[1]}" ;;
                git)       remote="${COMP_WORDS[2]}" ;;
                esac
                __gitcomp "$(__git_refs "$remote")"
-               ;;
-       esac
+       fi
  }
  
  _git_push ()
  {
        local cur="${COMP_WORDS[COMP_CWORD]}"
  
-       case "${COMP_WORDS[0]},$COMP_CWORD" in
-       git-push*,1)
-               __gitcomp "$(__git_remotes)"
-               ;;
-       git,2)
+       if [ "$COMP_CWORD" = 2 ]; then
                __gitcomp "$(__git_remotes)"
-               ;;
-       *)
+       else
                case "$cur" in
                *:*)
                        local remote
                        __gitcomp "$(__git_refs)"
                        ;;
                esac
-               ;;
-       esac
+       fi
  }
  
  _git_rebase ()
@@@ -1479,7 -1475,7 +1461,7 @@@ _git_submodule (
  {
        __git_has_doubledash && return
  
 -      local subcommands="add status init update"
 +      local subcommands="add status init update summary foreach sync"
        if [ -z "$(__git_find_subcommand "$subcommands")" ]; then
                local cur="${COMP_WORDS[COMP_CWORD]}"
                case "$cur" in
diff --combined diff.c
index 4e4e439e03f13a2bd9aaf63179ce50e4b72ed48e,f91f256c56e5e4be0b3f162695e1d35e63124569..02e948c9dd6244a0003c2c6bc81f55e46cf0ad2b
--- 1/diff.c
--- 2/diff.c
+++ b/diff.c
  
  static int diff_detect_rename_default;
  static int diff_rename_limit_default = 200;
 +static int diff_suppress_blank_empty;
  int diff_use_color_default = -1;
  static const char *external_diff_cmd_cfg;
  int diff_auto_refresh_index = 1;
 +static int diff_mnemonic_prefix;
  
  static char diff_colors[][COLOR_MAXLEN] = {
        "\033[m",       /* reset */
@@@ -156,10 -154,6 +156,10 @@@ int git_diff_ui_config(const char *var
                diff_auto_refresh_index = git_config_bool(var, value);
                return 0;
        }
 +      if (!strcmp(var, "diff.mnemonicprefix")) {
 +              diff_mnemonic_prefix = git_config_bool(var, value);
 +              return 0;
 +      }
        if (!strcmp(var, "diff.external"))
                return git_config_string(&external_diff_cmd_cfg, var, value);
        if (!prefixcmp(var, "diff.")) {
@@@ -187,12 -181,6 +187,12 @@@ int git_diff_basic_config(const char *v
                return 0;
        }
  
 +      /* like GNU diff's --suppress-blank-empty option  */
 +      if (!strcmp(var, "diff.suppress-blank-empty")) {
 +              diff_suppress_blank_empty = git_config_bool(var, value);
 +              return 0;
 +      }
 +
        if (!prefixcmp(var, "diff.")) {
                const char *ep = strrchr(var, '.');
                if (ep != var + 4) {
@@@ -328,15 -316,6 +328,15 @@@ static void emit_rewrite_diff(const cha
        const char *new = diff_get_color(color_diff, DIFF_FILE_NEW);
        const char *reset = diff_get_color(color_diff, DIFF_RESET);
        static struct strbuf a_name = STRBUF_INIT, b_name = STRBUF_INIT;
 +      const char *a_prefix, *b_prefix;
 +
 +      if (diff_mnemonic_prefix && DIFF_OPT_TST(o, REVERSE_DIFF)) {
 +              a_prefix = o->b_prefix;
 +              b_prefix = o->a_prefix;
 +      } else {
 +              a_prefix = o->a_prefix;
 +              b_prefix = o->b_prefix;
 +      }
  
        name_a += (*name_a == '/');
        name_b += (*name_b == '/');
  
        strbuf_reset(&a_name);
        strbuf_reset(&b_name);
 -      quote_two_c_style(&a_name, o->a_prefix, name_a, 0);
 -      quote_two_c_style(&b_name, o->b_prefix, name_b, 0);
 +      quote_two_c_style(&a_name, a_prefix, name_a, 0);
 +      quote_two_c_style(&b_name, b_prefix, name_b, 0);
  
        diff_populate_filespec(one, 0);
        diff_populate_filespec(two, 0);
@@@ -401,6 -380,7 +401,6 @@@ static void diff_words_append(char *lin
  }
  
  struct diff_words_data {
 -      struct xdiff_emit_state xm;
        struct diff_words_buffer minus, plus;
        FILE *file;
  };
@@@ -490,8 -470,11 +490,8 @@@ static void diff_words_show(struct diff
  
        xpp.flags = XDF_NEED_MINIMAL;
        xecfg.ctxlen = diff_words->minus.alloc + diff_words->plus.alloc;
 -      ecb.outf = xdiff_outf;
 -      ecb.priv = diff_words;
 -      diff_words->xm.consume = fn_out_diff_words_aux;
 -      xdi_diff(&minus, &plus, &xpp, &xecfg, &ecb);
 -
 +      xdi_diff_outf(&minus, &plus, fn_out_diff_words_aux, diff_words,
 +                    &xpp, &xecfg, &ecb);
        free(minus.ptr);
        free(plus.ptr);
        diff_words->minus.text.size = diff_words->plus.text.size = 0;
  typedef unsigned long (*sane_truncate_fn)(char *line, unsigned long len);
  
  struct emit_callback {
 -      struct xdiff_emit_state xm;
        int nparents, color_diff;
        unsigned ws_rule;
        sane_truncate_fn truncate;
@@@ -614,12 -598,6 +614,12 @@@ static void fn_out_consume(void *priv, 
                ecbdata->label_path[0] = ecbdata->label_path[1] = NULL;
        }
  
 +      if (diff_suppress_blank_empty
 +          && len == 2 && line[0] == ' ' && line[1] == '\n') {
 +              line[0] = '\n';
 +              len = 1;
 +      }
 +
        /* This is not really necessary for now because
         * this codepath only deals with two-way diffs.
         */
@@@ -748,6 -726,8 +748,6 @@@ static char *pprint_rename(const char *
  }
  
  struct diffstat_t {
 -      struct xdiff_emit_state xm;
 -
        int nr;
        int alloc;
        struct diffstat_file {
@@@ -1142,13 -1122,9 +1142,13 @@@ static void show_dirstat(struct diff_op
                /*
                 * Original minus copied is the removed material,
                 * added is the new material.  They are both damages
 -               * made to the preimage.
 +               * made to the preimage. In --dirstat-by-file mode, count
 +               * damaged files, not damaged lines. This is done by
 +               * counting only a single damaged line per file.
                 */
                damage = (p->one->size - copied) + added;
 +              if (DIFF_OPT_TST(options, DIRSTAT_BY_FILE) && damage > 0)
 +                      damage = 1;
  
                ALLOC_GROW(dir.files, dir.nr + 1, dir.alloc);
                dir.files[dir.nr].name = name;
@@@ -1181,6 -1157,7 +1181,6 @@@ static void free_diffstat_info(struct d
  }
  
  struct checkdiff_t {
 -      struct xdiff_emit_state xm;
        const char *filename;
        int lineno;
        struct diff_options *o;
@@@ -1422,9 -1399,6 +1422,9 @@@ static const struct funcname_pattern_en
  }
  
  static const struct funcname_pattern_entry builtin_funcname_pattern[] = {
 +      { "bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
 +        REG_EXTENDED },
 +      { "html", "^[ \t]*(<[Hh][1-6][ \t].*>.*)$", REG_EXTENDED },
        { "java",
          "!^[ \t]*(catch|do|for|if|instanceof|new|return|switch|throw|while)\n"
          "^[ \t]*(([ \t]*[A-Za-z_][A-Za-z_0-9]*){2,}[ \t]*\\([^;]*)$",
        { "pascal",
          "^((procedure|function|constructor|destructor|interface|"
                "implementation|initialization|finalization)[ \t]*.*)$"
 -        "|"
 +        "\n"
          "^(.*=[ \t]*(class|record).*)$",
          REG_EXTENDED },
 -      { "bibtex", "(@[a-zA-Z]{1,}[ \t]*\\{{0,1}[ \t]*[^ \t\"@',\\#}{~%]*).*$",
 +      { "php", "^[\t ]*((function|class).*)", REG_EXTENDED },
 +      { "python", "^[ \t]*((class|def)[ \t].*)$", REG_EXTENDED },
 +      { "ruby", "^[ \t]*((class|module|def)[ \t].*)$",
          REG_EXTENDED },
        { "tex",
          "^(\\\\((sub)*section|chapter|part)\\*{0,1}\\{.*)$",
          REG_EXTENDED },
 -      { "ruby", "^[ \t]*((class|module|def)[ \t].*)$",
 -        REG_EXTENDED },
  };
  
  static const struct funcname_pattern_entry *diff_funcname_pattern(struct diff_filespec *one)
        return NULL;
  }
  
 +void diff_set_mnemonic_prefix(struct diff_options *options, const char *a, const char *b)
 +{
 +      if (!options->a_prefix)
 +              options->a_prefix = a;
 +      if (!options->b_prefix)
 +              options->b_prefix = b;
 +}
 +
  static void builtin_diff(const char *name_a,
                         const char *name_b,
                         struct diff_filespec *one,
        char *a_one, *b_two;
        const char *set = diff_get_color_opt(o, DIFF_METAINFO);
        const char *reset = diff_get_color_opt(o, DIFF_RESET);
 +      const char *a_prefix, *b_prefix;
 +
 +      diff_set_mnemonic_prefix(o, "a/", "b/");
 +      if (DIFF_OPT_TST(o, REVERSE_DIFF)) {
 +              a_prefix = o->b_prefix;
 +              b_prefix = o->a_prefix;
 +      } else {
 +              a_prefix = o->a_prefix;
 +              b_prefix = o->b_prefix;
 +      }
  
 -      a_one = quote_two(o->a_prefix, name_a + (*name_a == '/'));
 -      b_two = quote_two(o->b_prefix, name_b + (*name_b == '/'));
+       /* Never use a non-valid filename anywhere if at all possible */
+       name_a = DIFF_FILE_VALID(one) ? name_a : name_b;
+       name_b = DIFF_FILE_VALID(two) ? name_b : name_a;
 +      a_one = quote_two(a_prefix, name_a + (*name_a == '/'));
 +      b_two = quote_two(b_prefix, name_b + (*name_b == '/'));
        lbl[0] = DIFF_FILE_VALID(one) ? a_one : "/dev/null";
        lbl[1] = DIFF_FILE_VALID(two) ? b_two : "/dev/null";
        fprintf(o->file, "%sdiff --git %s %s%s\n", set, a_one, b_two, reset);
                        xecfg.ctxlen = strtoul(diffopts + 10, NULL, 10);
                else if (!prefixcmp(diffopts, "-u"))
                        xecfg.ctxlen = strtoul(diffopts + 2, NULL, 10);
 -              ecb.outf = xdiff_outf;
 -              ecb.priv = &ecbdata;
 -              ecbdata.xm.consume = fn_out_consume;
                if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS)) {
                        ecbdata.diff_words =
                                xcalloc(1, sizeof(struct diff_words_data));
                        ecbdata.diff_words->file = o->file;
                }
 -              xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
 +              xdi_diff_outf(&mf1, &mf2, fn_out_consume, &ecbdata,
 +                            &xpp, &xecfg, &ecb);
                if (DIFF_OPT_TST(o, COLOR_DIFF_WORDS))
                        free_diff_words_data(&ecbdata);
        }
@@@ -1649,8 -1611,9 +1653,8 @@@ static void builtin_diffstat(const cha
  
                memset(&xecfg, 0, sizeof(xecfg));
                xpp.flags = XDF_NEED_MINIMAL | o->xdl_opts;
 -              ecb.outf = xdiff_outf;
 -              ecb.priv = diffstat;
 -              xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
 +              xdi_diff_outf(&mf1, &mf2, diffstat_consume, diffstat,
 +                            &xpp, &xecfg, &ecb);
        }
  
   free_and_return:
@@@ -1671,6 -1634,7 +1675,6 @@@ static void builtin_checkdiff(const cha
                return;
  
        memset(&data, 0, sizeof(data));
 -      data.xm.consume = checkdiff_consume;
        data.filename = name_b ? name_b : name_a;
        data.lineno = 0;
        data.o = o;
                memset(&xecfg, 0, sizeof(xecfg));
                xecfg.ctxlen = 1; /* at least one context line */
                xpp.flags = XDF_NEED_MINIMAL;
 -              ecb.outf = xdiff_outf;
 -              ecb.priv = &data;
 -              xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
 +              xdi_diff_outf(&mf1, &mf2, checkdiff_consume, &data,
 +                            &xpp, &xecfg, &ecb);
  
                if ((data.ws_rule & WS_TRAILING_SPACE) &&
                    data.trailing_blanks_start) {
@@@ -2367,10 -2332,8 +2371,10 @@@ void diff_setup(struct diff_options *op
                DIFF_OPT_CLR(options, COLOR_DIFF);
        options->detect_rename = diff_detect_rename_default;
  
 -      options->a_prefix = "a/";
 -      options->b_prefix = "b/";
 +      if (!diff_mnemonic_prefix) {
 +              options->a_prefix = "a/";
 +              options->b_prefix = "b/";
 +      }
  }
  
  int diff_setup_done(struct diff_options *options)
@@@ -2527,10 -2490,6 +2531,10 @@@ int diff_opt_parse(struct diff_options 
        else if (!strcmp(arg, "--cumulative")) {
                options->output_format |= DIFF_FORMAT_DIRSTAT;
                DIFF_OPT_SET(options, DIRSTAT_CUMULATIVE);
 +      } else if (opt_arg(arg, 0, "dirstat-by-file",
 +                         &options->dirstat_percent)) {
 +              options->output_format |= DIFF_FORMAT_DIRSTAT;
 +              DIFF_OPT_SET(options, DIRSTAT_BY_FILE);
        }
        else if (!strcmp(arg, "--check"))
                options->output_format |= DIFF_FORMAT_CHECKDIFF;
@@@ -3087,7 -3046,8 +3091,7 @@@ static void diff_summary(FILE *file, st
  }
  
  struct patch_id_t {
 -      struct xdiff_emit_state xm;
 -      SHA_CTX *ctx;
 +      git_SHA_CTX *ctx;
        int patchlen;
  };
  
@@@ -3115,7 -3075,7 +3119,7 @@@ static void patch_id_consume(void *priv
  
        new_len = remove_space(line, len);
  
 -      SHA1_Update(data->ctx, line, new_len);
 +      git_SHA1_Update(data->ctx, line, new_len);
        data->patchlen += new_len;
  }
  
@@@ -3124,13 -3084,14 +3128,13 @@@ static int diff_get_patch_id(struct dif
  {
        struct diff_queue_struct *q = &diff_queued_diff;
        int i;
 -      SHA_CTX ctx;
 +      git_SHA_CTX ctx;
        struct patch_id_t data;
        char buffer[PATH_MAX * 4 + 20];
  
 -      SHA1_Init(&ctx);
 +      git_SHA1_Init(&ctx);
        memset(&data, 0, sizeof(struct patch_id_t));
        data.ctx = &ctx;
 -      data.xm.consume = patch_id_consume;
  
        for (i = 0; i < q->nr; i++) {
                xpparam_t xpp;
                                        len2, p->two->path,
                                        len1, p->one->path,
                                        len2, p->two->path);
 -              SHA1_Update(&ctx, buffer, len1);
 +              git_SHA1_Update(&ctx, buffer, len1);
  
                xpp.flags = XDF_NEED_MINIMAL;
                xecfg.ctxlen = 3;
                xecfg.flags = XDL_EMIT_FUNCNAMES;
 -              ecb.outf = xdiff_outf;
 -              ecb.priv = &data;
 -              xdi_diff(&mf1, &mf2, &xpp, &xecfg, &ecb);
 +              xdi_diff_outf(&mf1, &mf2, patch_id_consume, &data,
 +                            &xpp, &xecfg, &ecb);
        }
  
 -      SHA1_Final(sha1, &ctx);
 +      git_SHA1_Final(sha1, &ctx);
        return 0;
  }
  
@@@ -3273,6 -3235,7 +3277,6 @@@ void diff_flush(struct diff_options *op
                struct diffstat_t diffstat;
  
                memset(&diffstat, 0, sizeof(struct diffstat_t));
 -              diffstat.xm.consume = diffstat_consume;
                for (i = 0; i < q->nr; i++) {
                        struct diff_filepair *p = q->queue[i];
                        if (check_pair_status(p))
diff --combined t/t4012-diff-binary.sh
index b8ec6e90afb970b1b2540e30901b2f058522544e,eac12712dbcf7a9f59c6c8ae0e5772b19662ab8a..421f4bba3fbc666cf2ab7ec4289f10d29d61eebb
@@@ -12,7 -12,7 +12,7 @@@ test_expect_success 'prepare repository
        'echo AIT >a && echo BIT >b && echo CIT >c && echo DIT >d &&
         git update-index --add a b c d &&
         echo git >a &&
 -       cat ../test4012.png >b &&
 +       cat "$TEST_DIRECTORY"/test4012.png >b &&
         echo git >c &&
         cat b b >d'
  
@@@ -77,4 -77,25 +77,25 @@@ test_expect_success 'apply binary patch
         tree1=`git write-tree` &&
         test "$tree1" = "$tree0"'
  
+ q_to_nul() {
+       perl -pe 'y/Q/\000/'
+ }
+ nul_to_q() {
+       perl -pe 'y/\000/Q/'
+ }
+ test_expect_success 'diff --no-index with binary creation' '
+       echo Q | q_to_nul >binary &&
+       (:# hide error code from diff, which just indicates differences
+        git diff --binary --no-index /dev/null binary >current ||
+        true
+       ) &&
+       rm binary &&
+       git apply --binary <current &&
+       echo Q >expected &&
+       nul_to_q <binary >actual &&
+       test_cmp expected actual
+ '
  test_done
diff --combined transport.c
index f7db5d91103c09a8cdc9bdbd27de4b0d4a15ea73,35cac441f88737c3b3d50e824a9fc1b9d25aec23..5110c56c4e80dc224ff3308e643fad6d5ed77ffb
@@@ -619,7 -619,7 +619,7 @@@ static struct ref *get_refs_via_connect
        struct ref *refs;
  
        connect_setup(transport);
 -      get_remote_heads(data->fd[0], &refs, 0, NULL, 0);
 +      get_remote_heads(data->fd[0], &refs, 0, NULL, 0, NULL);
  
        return refs;
  }
@@@ -643,8 -643,8 +643,8 @@@ static int fetch_refs_via_pack(struct t
        args.use_thin_pack = data->thin;
        args.include_tag = data->followtags;
        args.verbose = (transport->verbose > 0);
-       args.quiet = args.no_progress = (transport->verbose < 0);
-       args.no_progress = !isatty(1);
+       args.quiet = (transport->verbose < 0);
+       args.no_progress = args.quiet || !isatty(1);
        args.depth = data->depth;
  
        for (i = 0; i < nr_heads; i++)
  
        if (!data->conn) {
                connect_setup(transport);
 -              get_remote_heads(data->fd[0], &refs_tmp, 0, NULL, 0);
 +              get_remote_heads(data->fd[0], &refs_tmp, 0, NULL, 0, NULL);
        }
  
        refs = fetch_pack(&args, data->fd, data->conn,