Skip to content

Commit 7945c7f

Browse files
committed
Merge branch 'maint'
* maint: test-subprocess: fix segfault without arguments submodule: fix prototype of gitmodules_config
2 parents 926b1ec + fdec2eb commit 7945c7f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

submodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ enum {
1313
void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
1414
const char *path);
1515
int submodule_config(const char *var, const char *value, void *cb);
16-
void gitmodules_config();
16+
void gitmodules_config(void);
1717
int parse_submodule_config_option(const char *var, const char *value);
1818
void handle_ignore_submodules_arg(struct diff_options *diffopt, const char *);
1919
int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg);

test-subprocess.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
#include "cache.h"
22
#include "run-command.h"
33

4-
int main(int argc, char **argv)
4+
int main(int argc, const char **argv)
55
{
66
struct child_process cp;
77
int nogit = 0;
88

99
setup_git_directory_gently(&nogit);
1010
if (nogit)
1111
die("No git repo found");
12-
if (!strcmp(argv[1], "--setup-work-tree")) {
12+
if (argc > 1 && !strcmp(argv[1], "--setup-work-tree")) {
1313
setup_work_tree();
1414
argv++;
1515
}
1616
memset(&cp, 0, sizeof(cp));
1717
cp.git_cmd = 1;
18-
cp.argv = (const char **)argv+1;
18+
cp.argv = argv + 1;
1919
return run_command(&cp);
2020
}

0 commit comments

Comments
 (0)