git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Thomas Desveaux <desveaux.thomas@gmail.com>
To: git@vger.kernel.org
Subject: Git Bug Report: git credential 'url' parsing clear other fields
Date: Fri, 26 Apr 2024 21:27:03 +0200	[thread overview]
Message-ID: <CACPMLSqTA6pY3hiawhTAmhfvWME8NRUehauy6g-oUaHjordWqA@mail.gmail.com> (raw)

Hi,

I encountered what seems to be a small bug in git credential parsing.
Just want to confirm it's not expected behavior.
I'm willing to work on a patch.

First time submitting a bug to git (and a potential patch),
so let me know if I do anything wrong!

What did you do before the bug happened? (Steps to reproduce your issue)

Run git credential approve with the 'url' field of the form NOT as first entry.

example:
git -c credential.helper= -c "credential.helper=store
--file=.git-credentials" credential approve

input:
```
username=user
password=s3cret
url=https://example.com/repository.git
```

This next input works as intended.
input:
```
url=https://example.com/repository.git
username=user
password=s3cret
```

This was reproduced on both master and next branches.


What did you expect to happen? (Expected behavior)

Credentials should be saved with `username` and `password` provided.
`url` parsing should not clear the `credential` struct.


What happened instead? (Actual behavior)

`username` and `password` are correctly parsed and stored in the struct.
`url` parsing then clear the fields.


Culprit would be this `credential_clear` in `credential_from_url_1`.
On branch `next`, commit  `2a3ae87e7f8e9585d7565a8b5d6a6c9c28d6d943`.


Thanks,
Thomas Desveaux


             reply	other threads:[~2024-04-26 19:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 19:27 Thomas Desveaux [this message]
2024-04-29  5:25 ` Git Bug Report: git credential 'url' parsing clear other fields Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACPMLSqTA6pY3hiawhTAmhfvWME8NRUehauy6g-oUaHjordWqA@mail.gmail.com \
    --to=desveaux.thomas@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).