summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-06-28 13:38:48 -0700
committerJunio C Hamano <gitster@pobox.com>2017-06-28 14:27:10 -0700
commitdc4b4a61baac86bb75b0bdffb9ca45e90c4e194d (patch)
tree9d18510053e8853d3262b618f2448e501f205e1b
parent840ed141983718e0c5518a325534a5656797132a (diff)
downloadgit-jc/utf8-fprintf.tar.gz
submodule--helper: do not call utf8_fprintf() unnecessarilyjc/utf8-fprintf
The helper function utf8_fprintf(fp, ...) has exactly the same effect to the output stream fp as fprintf(fp, ...) does, and the only difference is that its return value counts in display columns consumed (assuming that the payload is encoded in UTF-8), as opposed to number of bytes. There is no reason to call it unless the caller cares about its return value. Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/submodule--helper.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index dbe5699fe6..704df874d1 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -4,7 +4,6 @@
#include "quote.h"
#include "pathspec.h"
#include "dir.h"
-#include "utf8.h"
#include "submodule.h"
#include "submodule-config.h"
#include "string-list.h"
@@ -298,7 +297,7 @@ static int module_list(int argc, const char **argv, const char *prefix)
else
printf("%06o %s %d\t", ce->ce_mode, sha1_to_hex(ce->sha1), ce_stage(ce));
- utf8_fprintf(stdout, "%s\n", ce->name);
+ fprintf(stdout, "%s\n", ce->name);
}
return 0;
}
@@ -887,7 +886,7 @@ static int update_clone(int argc, const char **argv, const char *prefix)
return 1;
for_each_string_list_item(item, &suc.projectlines)
- utf8_fprintf(stdout, "%s", item->string);
+ fprintf(stdout, "%s", item->string);
return 0;
}