githelper.git / githelper.pike

version» Context lines:

githelper.git/githelper.pike:102:    fail("Unable to parse output from git ls-files...\n");    return run_git("cat-file", "blob", blob);   }      string get_committed_file(string sha, string filename, int|void allow_empty)   {    string blob;    string treeentry = run_git("ls-tree", sha, "--", filename);    if (allow_empty && !sizeof(treeentry))    return ""; +  if (allow_empty == 2 && 2 == sscanf(treeentry, "%*o tree %s\t", blob)) +  return "";    if (2 != sscanf(treeentry, "%*o blob %s\t", blob))    fail("Unexpected output from git ls-tree\n");    return run_git("cat-file", "blob", blob);   }      string check_commit_timestamps(string commit)   {    int cct, cat, pct, pat;    string parents;    int sysclock = time() + 60;
githelper.git/githelper.pike:346:    while ((p = search(data, DOLLAR"Id", p))>=0) {    if (data[p..p+3] != unexpanded_id)    return 1;    p += 4;    }    return 0;    }       int check_ident(string filename)    { -  if (find_expanded_ident(get_file(filename, 1))) { +  if (find_expanded_ident(get_file(filename, 2))) {    write("File %s contains an expanded ident.\n", filename);    if(this_program == PreCommitHook) {    write("Try 'git reset %s; git add %s', "    "or remove the ident manually.\n",    @({filename})*2);;    }    return 1;    }    return 0;    }