[PATCH v2 3/5] fetch: Add the fetch.jobs config key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This allows users to default to parallel fetches, so they don't have to
pass --fetch-jobs=N on the command line every time.  The implementation
matches submodule.fetchjobs by die()ing on invalid job counts.

I couldn't find any documentation for submodule.fetchjobs, so I didn't
write any for this one.  I've tested this in my config and in
conjunction with the command-line argument.

Signed-off-by: Palmer Dabbelt <palmer@xxxxxxxxxx>
---
 builtin/fetch.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index fa12ad44e7d9..4c5f2ea3a931 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -104,6 +104,13 @@ static int git_fetch_config(const char *k, const char *v, void *cb)
 		return 0;
 	}
 
+	if (!strcmp(k, "fetch.jobs")) {
+		max_children_for_fetch = git_config_int(k, v);
+		if (max_children_for_fetch < 0)
+			die(_("negative values not allowed for fetch.jobs"));
+		return 0;
+	}
+
 	return git_default_config(k, v, cb);
 }
 
-- 
2.21.0




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux