From: Junio C Hamano Date: Wed, 12 Sep 2012 21:08:05 +0000 (-0700) Subject: Merge branch 'maint-1.7.11' into maint X-Git-Tag: v1.7.12.1~16 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3503e9ab32c7a478d0d985171c50a901a2695162;p=git.git Merge branch 'maint-1.7.11' into maint --- 3503e9ab32c7a478d0d985171c50a901a2695162 diff --cc builtin/rev-parse.c index 32788a9f8,47b4e7adb..25e225f06 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@@ -241,10 -236,21 +242,21 @@@ static int try_difference(const char *a next += symmetric; if (!*next) - next = "HEAD"; + next = head_by_default; if (dotdot == arg) - this = "HEAD"; + this = head_by_default; + + if (this == head_by_default && next == head_by_default && + !symmetric) { + /* + * Just ".."? That is not a range but the + * pathspec for the parent directory. + */ + *dotdot = '.'; + return 0; + } + - if (!get_sha1(this, sha1) && !get_sha1(next, end)) { + if (!get_sha1_committish(this, sha1) && !get_sha1_committish(next, end)) { show_rev(NORMAL, end, next); show_rev(symmetric ? NORMAL : REVERSED, sha1, this); if (symmetric) { diff --cc http.c index 18bc6bf7b,0a27b146a..9bac1d89f --- a/http.c +++ b/http.c @@@ -745,6 -744,33 +745,35 @@@ char *get_remote_object_url(const char return strbuf_detach(&buf, NULL); } + int handle_curl_result(struct active_request_slot *slot) + { + struct slot_results *results = slot->results; + + if (results->curl_result == CURLE_OK) { + credential_approve(&http_auth); + return HTTP_OK; + } else if (missing_target(results)) + return HTTP_MISSING_TARGET; + else if (results->http_code == 401) { + if (http_auth.username && http_auth.password) { + credential_reject(&http_auth); + return HTTP_NOAUTH; + } else { + credential_fill(&http_auth); + init_curl_http_auth(slot->curl); + return HTTP_REAUTH; + } + } else { ++#if LIBCURL_VERSION_NUM >= 0x070c00 + if (!curl_errorstr[0]) + strlcpy(curl_errorstr, + curl_easy_strerror(results->curl_result), + sizeof(curl_errorstr)); ++#endif + return HTTP_ERROR; + } + } + /* http_request() targets */ #define HTTP_REQUEST_STRBUF 0 #define HTTP_REQUEST_FILE 1 diff --cc revision.c index 442a94523,72104962d..cbcae1086 --- a/revision.c +++ b/revision.c @@@ -1140,11 -1141,22 +1141,22 @@@ int handle_revision_arg(const char *arg next += symmetric; if (!*next) - next = "HEAD"; + next = head_by_default; if (dotdot == arg) - this = "HEAD"; + this = head_by_default; + if (this == head_by_default && next == head_by_default && + !symmetric) { + /* + * Just ".."? That is not a range but the + * pathspec for the parent directory. + */ + if (!cant_be_filename) { + *dotdot = '.'; + return -1; + } + } - if (!get_sha1(this, from_sha1) && - !get_sha1(next, sha1)) { + if (!get_sha1_committish(this, from_sha1) && + !get_sha1_committish(next, sha1)) { struct commit *a, *b; struct commit_list *exclude; diff --cc t/lib-httpd/apache.conf index 36b1596a1,ec8618dfd..49d5d877c --- a/t/lib-httpd/apache.conf +++ b/t/lib-httpd/apache.conf @@@ -42,30 -42,25 +42,28 @@@ ErrorLog error.lo +PassEnv GIT_VALGRIND +PassEnv GIT_VALGRIND_OPTIONS + Alias /dumb/ www/ - Alias /auth/ www/auth/ + Alias /auth/dumb/ www/auth/dumb/ - + SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} SetEnv GIT_HTTP_EXPORT_ALL - - + + SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} - - + + SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH} SetEnv GIT_HTTP_EXPORT_ALL SetEnv GIT_COMMITTER_NAME "Custom User" SetEnv GIT_COMMITTER_EMAIL custom@example.com - - ScriptAlias /smart/ ${GIT_EXEC_PATH}/git-http-backend/ - ScriptAlias /smart_noexport/ ${GIT_EXEC_PATH}/git-http-backend/ - ScriptAlias /smart_custom_env/ ${GIT_EXEC_PATH}/git-http-backend/ + + ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1 - Options None + Options FollowSymlinks Options ExecCGI