githelper.git
/
githelper.pike
version
»
Context lines:
10
20
40
80
file
none
3
githelper.git/githelper.pike:387:
return 1; } } return 0; } int check_gitattributes_files() { foreach(files_to_commit, string filename) if(has_suffix(filename, "/.gitattributes")) {
-
write(".gitattributes are not allowed in
subdirectories\n
");
+
write(".gitattributes are not allowed in
subdirectories;
"
+
"please remove %s\n", filename
);
return 1; } if(search(files_to_commit, ".gitattributes")>=0) { GitAttributes old_attrs = GitAttributes(get_old_file(".gitattributes", 1)); array(string) new_f_i = sort(attrs->findattr("foreign_ident")); array(string) old_f_i = sort(old_attrs->findattr("foreign_ident")); array(string) added_fi = new_f_i - old_f_i; array(string) removed_fi = old_f_i - new_f_i; foreach(added_fi, string path) { if(!has_prefix(path, "/") || search(path, "*")>=0) {
-
write("
Added
unsupported foreign_ident: %s\n", path);
+
write("
Commit
adds
unsupported foreign_ident: %s\n", path);
return 1; } path = path[1..]; if (!entry_is_new(path)) {
-
write("
Added
foreign_ident to file %s\n", path);
+
write("
Commit
adds
foreign_ident to
existing
file %s\n", path);
return 1; } } foreach(removed_fi, string path) { if(has_prefix(path, "/")) path = path[1..]; if (search(files_to_commit, path)<0 && find_expanded_ident(get_file(path, 1))) {
-
write("
Removed
foreign_ident from unchanged file %s\n", path);
+
write("
Commit
removes
foreign_ident from unchanged file %s\n", path);
return 1; } } } return 0; } } class CommitHookUtilsRepo {