Skip to content

Commit

Permalink
osxkeychain: clarify that we ignore unknown lines
Browse files Browse the repository at this point in the history
Like in all the other credential helpers, the osxkeychain helper
ignores unknown credential lines.

Add a comment (a la the other helpers) to make it clear and explicit
that this is the desired behaviour.

Signed-off-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
mjcheetham authored and gitster committed Sep 22, 2022
1 parent 6ea87d9 commit 630a642
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions contrib/credential/osxkeychain/git-credential-osxkeychain.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,11 @@ static void read_credential(void)
username = xstrdup(v);
else if (!strcmp(buf, "password"))
password = xstrdup(v);
/*
* Ignore other lines; we don't know what they mean, but
* this future-proofs us when later versions of git do
* learn new lines, and the helpers are updated to match.
*/
}
}

Expand Down

0 comments on commit 630a642

Please sign in to comment.