githelper.git / githelper.pike

version» Context lines:

githelper.git/githelper.pike:304:    foreach(files_to_commit, string filename)    if(has_suffix(filename, "/.gitattributes")) {    write(".gitattributes are not allowed in subdirectories\n");    return 1;    }       if(search(files_to_commit, ".gitattributes")>=0) {    GitAttributes old_attrs =    GitAttributes(get_old_file(".gitattributes", 1));    -  array(string) new_f_e = sort(attrs->findattr("foreign_ident")); -  array(string) old_f_e = sort(old_attrs->findattr("foreign_ident")); -  array(string) added_fe = new_f_e - old_f_e; -  array(string) removed_fe = old_f_e - new_f_e; +  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_fe, string path) { +  foreach(added_fi, string path) {    if(!has_prefix(path, "/") || search(path, "*")>=0) {    write("Added 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);    return 1;    }    }    -  foreach(removed_fe, string path) { +  foreach(removed_fi, string path) {    if(has_prefix(path, "/"))    path = path[1..];    if (search(files_to_commit, path)<0) {    write("Removed foreign_ident from unchanged file %s\n", path);    return 1;    }    }    }    return 0;    }