feat(git): fetch/push/ff primitives with auth env, no task trailer in company repos
This commit is contained in:
@@ -6,7 +6,9 @@ namespace ClaudeDo.Worker.Runner;
|
||||
|
||||
public static class CommitMessageBuilder
|
||||
{
|
||||
public static string Build(string commitType, string listName, string taskTitle, string? taskDescription, string taskId)
|
||||
/// <summary>Task commit message; <paramref name="includeTrailer"/> is false in company repos, whose convention forbids signature trailers.</summary>
|
||||
public static string Build(string commitType, string listName, string taskTitle, string? taskDescription, string taskId,
|
||||
bool includeTrailer = true)
|
||||
{
|
||||
var slug = ToSlug(listName);
|
||||
var title = Truncate(taskTitle, 60);
|
||||
@@ -22,9 +24,11 @@ public static class CommitMessageBuilder
|
||||
sb.Append(Truncate(taskDescription!.Trim(), 400));
|
||||
}
|
||||
|
||||
// Trailer is always included.
|
||||
sb.Append("\n\n");
|
||||
sb.Append($"ClaudeDo-Task: {taskId}");
|
||||
if (includeTrailer)
|
||||
{
|
||||
sb.Append("\n\n");
|
||||
sb.Append($"ClaudeDo-Task: {taskId}");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -199,8 +199,10 @@ public sealed class WorktreeManager
|
||||
|
||||
await _git.AddAllAsync(ctx.WorktreePath, ct);
|
||||
|
||||
var isCompany = list.WorkingDir is not null
|
||||
&& await CompanyRepo.IsCompanyAsync(_git, list.WorkingDir, _cfg.CompanyRemotePattern, ct);
|
||||
var message = CommitMessageBuilder.Build(
|
||||
task.CommitType, list.Name, task.Title, task.Description, task.Id);
|
||||
task.CommitType, list.Name, task.Title, task.Description, task.Id, includeTrailer: !isCompany);
|
||||
|
||||
await _git.CommitAsync(ctx.WorktreePath, message, ct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user