| 2289 | } |
| 2290 | |
| 2291 | static char *resolve_compare_branch(struct branch *branch, const char *name) |
| 2292 | { |
| 2293 | const char *resolved = NULL; |
| 2294 | |
| 2295 | if (!branch || !name) |
| 2296 | return NULL; |
| 2297 | |
| 2298 | if (!strcasecmp(name, "@{upstream}")) { |
| 2299 | resolved = branch_get_upstream(branch, NULL); |
| 2300 | } else if (!strcasecmp(name, "@{push}")) { |
| 2301 | resolved = branch_get_push(branch, NULL); |
| 2302 | } else { |
| 2303 | warning(_("ignoring value '%s' for status.compareBranches, " |
| 2304 | "only @{upstream} and @{push} are supported"), |
| 2305 | name); |
| 2306 | return NULL; |
| 2307 | } |
| 2308 | |
| 2309 | if (resolved) |
| 2310 | return xstrdup(resolved); |
| 2311 | return NULL; |
| 2312 | } |
| 2313 | |
| 2314 | static void format_branch_comparison(struct strbuf *sb, |
| 2315 | bool up_to_date, |
no test coverage detected