Closed
Description
What are your thoughts on adding more information to FetchResult
?
I'd like to know the updated branches and especially deleted branches.
Currently I can get this via outputHandler()
, but it's messy since I can't return a result through.
Are you open to a PR that adds these fields? Are they deliberately elided (or non-standard between servers)?
Possible format for FetchResult
export interface FetchResult {
raw: string
remote: string | null
branches: {
name: string
tracking: string
}[]
tags: {
name: string
tracking: string
}[]
updated: {
name: string
tracking: string
to: string
from: string
}[]
deleted: {
tracking: string
}[]
}
LineParsers
new LineParser(/- \[deleted]\s+\S+\s*-> (.+)$/, (result, [tracking]) => {
result.deleted.push({
tracking,
})
}),
new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [to, from, name, tracking]) => {
result.updated.push({
name,
tracking,
to,
from,
})
}),