githelper.git / githelper.pike

version» Context lines:

githelper.git/githelper.pike:185:    /* Allowed control character */    break;    default:    if (c<32 || (c>=0x80 && c<0xa0))    return sprintf("Forbidden control character 0x%02x detected\n", c);    }    };    return err && err[0];   }    - string check_commit_msg(string commit) - { -  string message = run_git("cat-file", "commit", commit); -  string encoding = 0; -  string headers = (message/"\n\n")[0]; -  foreach(headers/"\n", string headerline) { -  if(has_prefix(headerline, "encoding ")) -  encoding = headerline[9..]; -  } -  return check_encoding(message, encoding); - } -  +    class GitAttributes   {    enum {    ATTR_TRUE = 1,    ATTR_FALSE = 2,    ATTR_UNSET = 3    };       class AttrState(string attr, string|int setto) {    protected string _sprintf(int type) {
githelper.git/githelper.pike:498:    {    return get_committed_file(parent, filename, allow_empty);    }       int entry_is_new(string filename)    {    return (!sizeof(run_git("ls-tree", parent, "--", filename))) &&    sizeof(run_git("ls-tree", sha, "--", filename));    }    +  string check_commit_msg(string commit) +  { +  string message = run_git("cat-file", "commit", commit); +  string encoding = 0; +  string headers = (message/"\n\n")[0]; +  foreach(headers/"\n", string headerline) { +  if(has_prefix(headerline, "encoding ")) +  encoding = headerline[9..]; +  } +  +  return check_encoding(message, encoding); +  } +     int check_commit(string sha)    {    if (!has_prefix(sha, "HEAD"))    write("Checking commit %s\n", sha);    this_program::sha = sha;    array(string) parents = split_lf(run_git("rev-list", "--parents",    "-n", "1", sha))[0] / " ";    if (sizeof(parents) > 1)    parent = parents[1]; // First parent, sha^    else