author | Junio C Hamano <gitster@pobox.com> | |
Tue, 20 Dec 2011 00:05:16 +0000 (16:05 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 20 Dec 2011 00:05:16 +0000 (16:05 -0800) |
* jk/credentials:
t: add test harness for external credential helpers
credentials: add "store" helper
strbuf: add strbuf_add*_urlencode
Makefile: unix sockets may not available on some platforms
credentials: add "cache" helper
docs: end-user documentation for the credential subsystem
credential: make relevance of http path configurable
credential: add credential.*.username
credential: apply helper config
http: use credential API to get passwords
credential: add function for parsing url components
introduce credentials API
t5550: fix typo
test-lib: add test_config_global variant
Conflicts:
strbuf.c
t: add test harness for external credential helpers
credentials: add "store" helper
strbuf: add strbuf_add*_urlencode
Makefile: unix sockets may not available on some platforms
credentials: add "cache" helper
docs: end-user documentation for the credential subsystem
credential: make relevance of http path configurable
credential: add credential.*.username
credential: apply helper config
http: use credential API to get passwords
credential: add function for parsing url components
introduce credentials API
t5550: fix typo
test-lib: add test_config_global variant
Conflicts:
strbuf.c
1 | 2 | |||
---|---|---|---|---|
Documentation/config.txt | patch | | diff1 | | diff2 | | blob | history |
Makefile | patch | | diff1 | | diff2 | | blob | history |
git-compat-util.h | patch | | diff1 | | diff2 | | blob | history |
http.c | patch | | diff1 | | diff2 | | blob | history |
strbuf.c | patch | | diff1 | | diff2 | | blob | history |
strbuf.h | patch | | diff1 | | diff2 | | blob | history |
diff --cc Documentation/config.txt
Simple merge
diff --cc Makefile
Simple merge
diff --cc git-compat-util.h
Simple merge
diff --cc http.c
index 44fcc4d178fcedaa87f1917608dd32a65c24c98a,917a1ae7d088f56cd704acb60a5eefa02bb72edc..8e72664061b1bafe18a51bc1fdcb3f36a4eeb1d5
+++ b/http.c
#include "sideband.h"
#include "run-command.h"
#include "url.h"
+ #include "credential.h"
-int data_received;
int active_requests;
int http_is_verbose;
size_t http_post_buffer = 16 * LARGE_PACKET_MAX;
diff --cc strbuf.c
index a849705197a6ad3d0d2ab9de22b269de6b4fc2b1,60e5e598dd4e49e8b2fd37b0bbb5040639b4411d..ff0b96b4162bd92162a7eb05eee5be7a5ec2b6ba
+++ b/strbuf.c
return len;
}
+void strbuf_add_lines(struct strbuf *out, const char *prefix,
+ const char *buf, size_t size)
+{
+ while (size) {
+ const char *next = memchr(buf, '\n', size);
+ next = next ? (next + 1) : (buf + size);
+ strbuf_addstr(out, prefix);
+ strbuf_add(out, buf, next - buf);
+ size -= next - buf;
+ buf = next;
+ }
+ strbuf_complete_line(out);
+}
++
+ static int is_rfc3986_reserved(char ch)
+ {
+ switch (ch) {
+ case '!': case '*': case '\'': case '(': case ')': case ';':
+ case ':': case '@': case '&': case '=': case '+': case '$':
+ case ',': case '/': case '?': case '#': case '[': case ']':
+ return 1;
+ }
+ return 0;
+ }
+
+ static int is_rfc3986_unreserved(char ch)
+ {
+ return isalnum(ch) ||
+ ch == '-' || ch == '_' || ch == '.' || ch == '~';
+ }
+
+ void strbuf_add_urlencode(struct strbuf *sb, const char *s, size_t len,
+ int reserved)
+ {
+ strbuf_grow(sb, len);
+ while (len--) {
+ char ch = *s++;
+ if (is_rfc3986_unreserved(ch) ||
+ (!reserved && is_rfc3986_reserved(ch)))
+ strbuf_addch(sb, ch);
+ else
+ strbuf_addf(sb, "%%%02x", ch);
+ }
+ }
+
+ void strbuf_addstr_urlencode(struct strbuf *sb, const char *s,
+ int reserved)
+ {
+ strbuf_add_urlencode(sb, s, strlen(s), reserved);
+ }
diff --cc strbuf.h
Simple merge