Andreas Ericsson  committed 33ebb87

git wrapper: fix command name in an error message.

When the command execution by execv_git_cmd() fails with an errno
other than ENOENT, we used an uninitialized variable instead of
the string that holds the command name to report what failed.

Signed-off-by: Junio C Hamano <>

  • Participants
  • Parent commits 80f5074
  • Branches master

Comments (0)

Files changed (1)

 	const char *cmd = argv[0];
 	char *slash = strrchr(cmd, '/');
-	char git_command[PATH_MAX + 1];
 	const char *exec_path = NULL;
 	int done_alias = 0;
 		cmd_usage(0, exec_path, "'%s' is not a git-command", cmd);
 	fprintf(stderr, "Failed to run command '%s': %s\n",
-		git_command, strerror(errno));
+		cmd, strerror(errno));
 	return 1;