Skip to content

Commit d695804

Browse files
mjcheethamgitster
authored andcommitted
wincred: ignore unknown lines (do not die)
It is the expectation that credential helpers be liberal in what they accept and conservative in what they return, to allow for future growth and evolution of the protocol/interaction. All of the other helpers (store, cache, osxkeychain, libsecret, gnome-keyring) except `netrc` currently ignore any credential lines that are not recognised, whereas the Windows helper (wincred) instead dies. Fix the discrepancy and ignore unknown lines in the wincred helper. Signed-off-by: Matthew John Cheetham <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1b3d6e1 commit d695804

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

contrib/credential/wincred/git-credential-wincred.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,11 @@ static void read_credential(void)
278278
wusername = utf8_to_utf16_dup(v);
279279
} else if (!strcmp(buf, "password"))
280280
password = utf8_to_utf16_dup(v);
281-
else
282-
die("unrecognized input");
281+
/*
282+
* Ignore other lines; we don't know what they mean, but
283+
* this future-proofs us when later versions of git do
284+
* learn new lines, and the helpers are updated to match.
285+
*/
283286
}
284287
}
285288

0 commit comments

Comments
 (0)