diff options
Diffstat (limited to 'credential-store.c')
-rw-r--r-- | credential-store.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/credential-store.c b/credential-store.c index c519f8025e..d62dc29d06 100644 --- a/credential-store.c +++ b/credential-store.c @@ -165,11 +165,16 @@ int main(int argc, char **argv) usage_with_options(usage, options); op = argv[0]; - if (!file) - file = expand_user_path("~/.git-credentials"); - if (file) + if (file) { string_list_append(&fns, file); - else + } else { + if ((file = expand_user_path("~/.git-credentials"))) + string_list_append_nodup(&fns, file); + home_config_paths(NULL, &file, "credentials"); + if (file) + string_list_append_nodup(&fns, file); + } + if (!fns.nr) die("unable to set up default path; use --file"); if (credential_read(&c, stdin) < 0) |