githelper.git / githelper.pike

version» Context lines:

githelper.git/githelper.pike:560:       if (sizeof(run_git("diff", "--name-only", "--", ".gitattributes"))) {    write("You have unstaged changes to .gitattributes.\n"    "Please add or stash them before commit.\n");    return 1;    }    }       int check_not_tracking()    { -  string local_branch = run_git("symbolic-ref", "HEAD"); +  string local_branch = run_git_ex(128, "symbolic-ref", "HEAD"); +  if (local_branch == "") { +  return 0; +  }    if (!has_prefix(local_branch, "refs/heads/")) {    write("Attempt to commit to non-branch: %s.\n", local_branch);    }    if (has_prefix(local_branch, "refs/heads/tracking/")) {    write("Attempt to commit to tracking branch.\n");    return 1;    }    local_branch = local_branch[sizeof("refs/heads/")..];    if (has_suffix(local_branch, "\n")) {    local_branch = local_branch[..<1];