Skip to content

Commit abb2770

Browse files
committed
psuh: show parameters & config opts
Signed-off-by: Long Nguyen <n.h.long.9697@gmail.com>
1 parent bf755a7 commit abb2770

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

builtin/psuh.c

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,28 @@
11
#include "builtin.h"
22
#include "gettext.h"
33

4-
int cmd_psuh(int argc UNUSED, const char **argv UNUSED,
5-
const char *prefix UNUSED, struct repository *repo UNUSED) {
6-
printf(_("Pony saying hello goes here.\n"));
7-
return 0;
4+
int cmd_psuh(int argc, const char **argv,
5+
const char *prefix, struct repository *repo) {
6+
int i;
7+
const char *config_name;
8+
printf(_("Pushing to %s\n"), repo->name);
9+
printf(_("Pushing to %s\n"), repo->url);
10+
printf(Q_("Your args (there is %d):\n",
11+
"Your args (there are %d):\n",
12+
argc),
13+
argc);
14+
for (i = 0; i < argc; i++)
15+
printf("%d: %s\n", i, argv[i]);
16+
17+
printf(_("Your current working directory:\n<top-level>%s%s\n"),
18+
prefix ? "/" : "", prefix ? prefix : "");
19+
20+
repo_config(repo, git_default_config, NULL);
21+
22+
if (repo_config_get_string_tmp(repo, "user.name", &config_name))
23+
printf(_("No name is found in config\n"));
24+
else
25+
printf(_("Your name: %s\n"), config_name);
26+
27+
return 0;
828
}

0 commit comments

Comments
 (0)