quote_path_relative(): remove redundant parameter

quote_path_relative() used to take a counted string as its parameter
(the string to be quoted).  With an earlier change, it now uses
relative_path() that does not take a counted string, and we have
been passing only the pointer to the string since then.

Remove the length parameter from quote_path_relative() to show that
this parameter was redundant.  All the changed lines show that the
caller passed either -1 (to ask the function run strlen() on the
string), or the length of the string, so the earlier conversion was
safe.

All the callers of quote_path_relative() that used to take counted string
have been audited to make sure that they are passing length of the actual
string (or -1 to ask the callee run strlen())

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jiang Xin
2013-06-25 23:53:45 +08:00
committed by Junio C Hamano
parent ad66df2df1
commit 39598f9983
6 changed files with 24 additions and 29 deletions

View File

@ -394,7 +394,7 @@ int report_path_error(const char *ps_matched, const char **pathspec, const char
if (found_dup)
continue;
name = quote_path_relative(pathspec[num], -1, &sb, prefix);
name = quote_path_relative(pathspec[num], prefix, &sb);
error("pathspec '%s' did not match any file(s) known to git.",
name);
errors++;