Skip to content

Commit 72801df

Browse files
committed
Merge branch 'ua/update-update-server-info'
Code simplification. * ua/update-update-server-info: builtin/update-server-info: remove unnecessary if statement
2 parents c3ebf18 + 9ec327d commit 72801df

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

builtin/update-server-info.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ int cmd_update_server_info(int argc,
2020
OPT_END()
2121
};
2222

23-
if (repo)
24-
repo_config(repo, git_default_config, NULL);
23+
repo_config(repo, git_default_config, NULL);
24+
2525
argc = parse_options(argc, argv, prefix, options,
2626
update_server_info_usage, 0);
2727
if (argc > 0)

t/t1517-outside-repo.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,11 @@ test_expect_success LIBCURL 'remote-http outside repository' '
107107
test_grep "^error: remote-curl" actual
108108
'
109109

110+
test_expect_success 'update-server-info does not crash with -h' '
111+
test_expect_code 129 git update-server-info -h >usage &&
112+
test_grep "[Uu]sage: git update-server-info " usage &&
113+
test_expect_code 129 nongit git update-server-info -h >usage &&
114+
test_grep "[Uu]sage: git update-server-info " usage
115+
'
116+
110117
test_done

0 commit comments

Comments
 (0)