Changeset 782 for git/branches/dmik/builtin/check-attr.c
- Timestamp:
- Jun 23, 2014, 9:45:51 PM (11 years ago)
- Location:
- git/branches/dmik
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
git/branches/dmik ¶
- Property svn:mergeinfo changed
/git/vendor/2.0.0 (added) merged: 777 /git/vendor/current merged: 772,774,776
- Property svn:mergeinfo changed
-
TabularUnified git/branches/dmik/builtin/check-attr.c ¶
r626 r782 9 9 static int stdin_paths; 10 10 static const char * const check_attr_usage[] = { 11 "git check-attr [-a | --all | attr...] [--] pathname...",12 "git check-attr --stdin [-a | --all | attr...] < <list-of-paths>",11 N_("git check-attr [-a | --all | attr...] [--] pathname..."), 12 N_("git check-attr --stdin [-z] [-a | --all | attr...] < <list-of-paths>"), 13 13 NULL 14 14 }; 15 15 16 static int nul l_term_line;16 static int nul_term_line; 17 17 18 18 static const struct option check_attr_options[] = { 19 OPT_BOOL EAN('a', "all", &all_attrs, "report all attributes set on file"),20 OPT_BOOL EAN(0, "cached", &cached_attrs, "use .gitattributes only from the index"),21 OPT_BOOL EAN(0 , "stdin", &stdin_paths, "read file names from stdin"),22 OPT_BOOL EAN('z', NULL, &null_term_line,23 "input paths are terminated by a null character"),19 OPT_BOOL('a', "all", &all_attrs, N_("report all attributes set on file")), 20 OPT_BOOL(0, "cached", &cached_attrs, N_("use .gitattributes only from the index")), 21 OPT_BOOL(0 , "stdin", &stdin_paths, N_("read file names from stdin")), 22 OPT_BOOL('z', NULL, &nul_term_line, 23 N_("terminate input and output records by a NUL character")), 24 24 OPT_END() 25 25 }; … … 39 39 value = "unspecified"; 40 40 41 quote_c_style(file, NULL, stdout, 0); 42 printf(": %s: %s\n", git_attr_name(check[j].attr), value); 41 if (nul_term_line) { 42 printf("%s%c" /* path */ 43 "%s%c" /* attrname */ 44 "%s%c" /* attrvalue */, 45 file, 0, git_attr_name(check[j].attr), 0, value, 0); 46 } else { 47 quote_c_style(file, NULL, stdout, 0); 48 printf(": %s: %s\n", git_attr_name(check[j].attr), value); 49 } 50 43 51 } 44 52 } … … 66 74 { 67 75 struct strbuf buf, nbuf; 68 int line_termination = nul l_term_line ? 0 : '\n';76 int line_termination = nul_term_line ? 0 : '\n'; 69 77 70 78 strbuf_init(&buf, 0); … … 94 102 struct git_attr_check *check; 95 103 int cnt, i, doubledash, filei; 104 105 if (!is_bare_repository()) 106 setup_work_tree(); 96 107 97 108 git_config(git_default_config, NULL);
Note:
See TracChangeset
for help on using the changeset viewer.