]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'ab/credentials-in-url-more'
authorJunio C Hamano <gitster@pobox.com>
Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 Jun 2022 17:33:32 +0000 (10:33 -0700)
Rename fetch.credentialsInUrl to transfer.credentialsInUrl as the
single configuration variable should work both in pushing and
fetching.

* ab/credentials-in-url-more:
  transfer doc: move fetch.credentialsInUrl to "transfer" config namespace
  fetch doc: note "pushurl" caveat about "credentialsInUrl", elaborate

1  2 
Documentation/RelNotes/2.37.0.txt
remote.c
t/t5516-fetch-push.sh
t/t5601-clone.sh

index e491a4b7baf493375f4600442d9857e70adce389,9902a74f34ae8592eb6281ad8ac73b47c972324f..bf00ccc4371e04c39f0ea2f25161715c6d935b6d
@@@ -54,18 -54,11 +54,20 @@@ UI, Workflows & Feature
  
   * Update the doctype written in gitweb output to xhtml5.
  
-  * The "fetch.credentialsInUrl" configuration variable controls what
-    happens when a URL with embedded login credential is used.
+  * The "transfer.credentialsInUrl" configuration variable controls what
+    happens when a URL with embedded login credential is used on either
+    "fetch" or "push". Credentials are currently only detected in
+    `remote.<name>.url` config, not `remote.<name>.pushurl`.
  
 + * "git revert" learns "--reference" option to use more human-readable
 +   reference to the commit it reverts in the message template it
 +   prepares for the user.
 +
 + * Various error messages that talk about the removal of
 +   "--preserve-merges" in "rebase" have been strengthened, and "rebase
 +   --abort" learned to get out of a state that was left by an earlier
 +   use of the option.
 +
  
  Performance, Internal Implementation, Development Support etc.
  
diff --cc remote.c
Simple merge
index c1220b2ed35d68cd0cdabe4fb9b34c4578039654,79d8a7b36752dcb5e7c5758c3d8a587f1c24310d..541adbb31034f11820c77972719258ef49131353
@@@ -1834,12 -1834,12 +1834,12 @@@ test_expect_success 'refuse to push a h
        test_dir_is_empty testrepo/.git/objects/pack
  '
  
 -test_expect_success 'fetch warns or fails when using username:password' '
 +test_expect_success LIBCURL 'fetch warns or fails when using username:password' '
        message="URL '\''https://username:<redacted>@localhost/'\'' uses plaintext credentials" &&
-       test_must_fail git -c fetch.credentialsInUrl=allow fetch https://username:password@localhost 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=allow fetch https://username:password@localhost 2>err &&
        ! grep "$message" err &&
  
-       test_must_fail git -c fetch.credentialsInUrl=warn fetch https://username:password@localhost 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=warn fetch https://username:password@localhost 2>err &&
        grep "warning: $message" err >warnings &&
        test_line_count = 3 warnings &&
  
  '
  
  
 -test_expect_success 'push warns or fails when using username:password' '
 +test_expect_success LIBCURL 'push warns or fails when using username:password' '
        message="URL '\''https://username:<redacted>@localhost/'\'' uses plaintext credentials" &&
-       test_must_fail git -c fetch.credentialsInUrl=allow push https://username:password@localhost 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=allow push https://username:password@localhost 2>err &&
        ! grep "$message" err &&
  
-       test_must_fail git -c fetch.credentialsInUrl=warn push https://username:password@localhost 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=warn push https://username:password@localhost 2>err &&
        grep "warning: $message" err >warnings &&
-       test_must_fail git -c fetch.credentialsInUrl=die push https://username:password@localhost 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=die push https://username:password@localhost 2>err &&
        grep "fatal: $message" err >warnings &&
        test_line_count = 1 warnings
  '
index eeed233362dbaf3145db8f8d6da744e302b32f1f,e6a248bbdccd5025838a0fd3122d0590ed4ad3d7..cf3be0584f40d13ba187cd8c04efc358910714a7
@@@ -71,12 -71,12 +71,12 @@@ test_expect_success 'clone respects GIT
  
  '
  
 -test_expect_success 'clone warns or fails when using username:password' '
 +test_expect_success LIBCURL 'clone warns or fails when using username:password' '
        message="URL '\''https://username:<redacted>@localhost/'\'' uses plaintext credentials" &&
-       test_must_fail git -c fetch.credentialsInUrl=allow clone https://username:password@localhost attempt1 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=allow clone https://username:password@localhost attempt1 2>err &&
        ! grep "$message" err &&
  
-       test_must_fail git -c fetch.credentialsInUrl=warn clone https://username:password@localhost attempt2 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=warn clone https://username:password@localhost attempt2 2>err &&
        grep "warning: $message" err >warnings &&
        test_line_count = 2 warnings &&
  
@@@ -89,8 -89,8 +89,8 @@@
        test_line_count = 1 warnings
  '
  
 -test_expect_success 'clone does not detect username:password when it is https://username@domain:port/' '
 +test_expect_success LIBCURL 'clone does not detect username:password when it is https://username@domain:port/' '
-       test_must_fail git -c fetch.credentialsInUrl=warn clone https://username@localhost:8080 attempt3 2>err &&
+       test_must_fail git -c transfer.credentialsInUrl=warn clone https://username@localhost:8080 attempt3 2>err &&
        ! grep "uses plaintext credentials" err
  '