aboutsummaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-03-04 17:31:21 -0800
committerJunio C Hamano <junkio@cox.net>2007-03-04 17:31:21 -0800
commit3ddad98b74924d76116d05e7601ab1e163d68500 (patch)
tree203307192a8a98545f0cb892ed477766f622c9cf /fetch-pack.c
parente6f95113431f7e69263bc3d075c0a7715ce587e3 (diff)
parentb0e908977ebe43b49badad7fe34bf259dd5d263b (diff)
downloadgit-3ddad98b74924d76116d05e7601ab1e163d68500.tar.gz
git-3ddad98b74924d76116d05e7601ab1e163d68500.tar.xz
Merge branch 'js/fetch-progress' (early part)
* 'js/fetch-progress' (early part): Fixup no-progress for fetch & clone fetch & clone: do not output progress when not on a tty Conflicts: git-fetch.sh
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 41bdd27b8..06f4aeced 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -15,8 +15,9 @@ static int quiet;
static int verbose;
static int fetch_all;
static int depth;
+static int no_progress;
static const char fetch_pack_usage[] =
-"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]";
+"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]";
static const char *uploadpack = "git-upload-pack";
#define COMPLETE (1U << 0)
@@ -173,12 +174,13 @@ static int find_common(int fd[2], unsigned char *result_sha1,
}
if (!fetching)
- packet_write(fd[1], "want %s%s%s%s%s%s\n",
+ packet_write(fd[1], "want %s%s%s%s%s%s%s\n",
sha1_to_hex(remote),
(multi_ack ? " multi_ack" : ""),
(use_sideband == 2 ? " side-band-64k" : ""),
(use_sideband == 1 ? " side-band" : ""),
(use_thin_pack ? " thin-pack" : ""),
+ (no_progress ? " no-progress" : ""),
" ofs-delta");
else
packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
@@ -521,7 +523,7 @@ static int get_pack(int xd[2])
if (do_keep) {
*av++ = "index-pack";
*av++ = "--stdin";
- if (!quiet)
+ if (!quiet && !no_progress)
*av++ = "-v";
if (use_thin_pack)
*av++ = "--fix-thin";
@@ -718,6 +720,10 @@ int main(int argc, char **argv)
st.st_mtime = 0;
continue;
}
+ if (!strcmp("--no-progress", arg)) {
+ no_progress = 1;
+ continue;
+ }
usage(fetch_pack_usage);
}
dest = arg;