Merge branch 'maint-1.7.11' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2012 21:08:05 +0000 (14:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Sep 2012 21:08:05 +0000 (14:08 -0700)
1  2 
builtin/apply.c
builtin/rev-parse.c
http.c
revision.c
t/lib-httpd.sh
t/lib-httpd/apache.conf

diff --cc builtin/apply.c
Simple merge
index 32788a9f86427237d0f4838362c1e3bc722fa258,47b4e7adb956517c22edc580892d63a99d9f219a..25e225f06717bfc2fd1f988269ff503a907d9302
@@@ -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 18bc6bf7bf17bab9037fade3af2151da6b298b2d,0a27b146adb15ad97407ed2c196878058f0ccec8..9bac1d89fdb639f6991bfe9f683ccf7bd5ada4cb
--- 1/http.c
--- 2/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 442a9452334704d90e4457fdeb11014fb886c58a,72104962d36b9672fd9dfc6ec850c99ccfc3803c..cbcae1086b346e2b956db7ef9b2729385eaa2ec9
@@@ -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.sh
Simple merge
index 36b1596a10c04b5c5c095e96e8e247463eb3f022,ec8618dfde3b106c79f1d056bc0ed085075fc8c8..49d5d877ceeeba3738b0939f14d059c2a75ff3ae
@@@ -42,30 -42,25 +42,28 @@@ ErrorLog error.lo
  </IfModule>
  </IfVersion>
  
 +PassEnv GIT_VALGRIND
 +PassEnv GIT_VALGRIND_OPTIONS
 +
  Alias /dumb/ www/
- Alias /auth/ www/auth/
+ Alias /auth/dumb/ www/auth/dumb/
  
- <Location /smart/>
+ <LocationMatch /smart/>
        SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
        SetEnv GIT_HTTP_EXPORT_ALL
- </Location>
- <Location /smart_noexport/>
+ </LocationMatch>
+ <LocationMatch /smart_noexport/>
        SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
- </Location>
- <Location /smart_custom_env/>
+ </LocationMatch>
+ <LocationMatch /smart_custom_env/>
        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
- </Location>
- 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/
+ </LocationMatch>
+ ScriptAliasMatch /smart_*[^/]*/(.*) ${GIT_EXEC_PATH}/git-http-backend/$1
  <Directory ${GIT_EXEC_PATH}>
 -      Options None
 +      Options FollowSymlinks
  </Directory>
  <Files ${GIT_EXEC_PATH}/git-http-backend>
        Options ExecCGI