Merge branch 'kh/branch-ref-syntax-advice'
When git refuses to create a branch because the proposed branch name is not a valid refname, an advice message is given to refer the user to exact naming rules. * kh/branch-ref-syntax-advice: branch: advise about ref syntax rules advice: use double quotes for regular quoting advice: use backticks for verbatim advice: make all entries stylistically consistent t3200: improve test style
This commit is contained in:
@@ -582,8 +582,12 @@ static void copy_or_rename_branch(const char *oldname, const char *newname, int
|
||||
*/
|
||||
if (ref_exists(oldref.buf))
|
||||
recovery = 1;
|
||||
else
|
||||
die(_("invalid branch name: '%s'"), oldname);
|
||||
else {
|
||||
int code = die_message(_("invalid branch name: '%s'"), oldname);
|
||||
advise_if_enabled(ADVICE_REF_SYNTAX,
|
||||
_("See `man git check-ref-format`"));
|
||||
exit(code);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; worktrees[i]; i++) {
|
||||
|
||||
Reference in New Issue
Block a user