mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Merge branch 'master' into next
* master: If abbrev is set to zero in git-describe, don't add the unique suffix fix suggested branch creation command when detaching head
This commit is contained in:
@@ -188,8 +188,11 @@ static void describe(const char *arg, int last_one)
|
||||
sha1_to_hex(gave_up_on->object.sha1));
|
||||
}
|
||||
}
|
||||
printf("%s-g%s\n", all_matches[0].name->path,
|
||||
find_unique_abbrev(cmit->object.sha1, abbrev));
|
||||
if (abbrev == 0)
|
||||
printf("%s\n", all_matches[0].name->path );
|
||||
else
|
||||
printf("%s-g%s\n", all_matches[0].name->path,
|
||||
find_unique_abbrev(cmit->object.sha1, abbrev));
|
||||
|
||||
if (!last_one)
|
||||
clear_commit_marks(cmit, -1);
|
||||
@@ -212,7 +215,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
|
||||
tags = 1;
|
||||
else if (!strncmp(arg, "--abbrev=", 9)) {
|
||||
abbrev = strtoul(arg + 9, NULL, 10);
|
||||
if (abbrev < MINIMUM_ABBREV || 40 < abbrev)
|
||||
if (abbrev != 0 && (abbrev < MINIMUM_ABBREV || 40 < abbrev))
|
||||
abbrev = DEFAULT_ABBREV;
|
||||
}
|
||||
else if (!strncmp(arg, "--candidates=", 13)) {
|
||||
|
||||
@@ -156,9 +156,9 @@ then
|
||||
if test -n "$oldbranch"
|
||||
then
|
||||
detach_warn="warning: you are not on ANY branch anymore.
|
||||
If you meant to create a new branch from the commit, you need -b to
|
||||
associate a new branch with the wanted checkout. Example:
|
||||
git checkout -b <new_branch_name> $arg"
|
||||
If you meant to create a new branch from this checkout, you may still do
|
||||
so (now or later) by using -b with the checkout command again. Example:
|
||||
git checkout -b <new_branch_name>"
|
||||
fi
|
||||
elif test -z "$oldbranch" && test -n "$branch"
|
||||
then
|
||||
|
||||
Reference in New Issue
Block a user