Merge branch 'sg/describe-contains'
"git describe" without argument defaulted to describe the HEAD commit, but "git describe --contains" didn't. Arguably, in a repository used for active development, such defaulting would not be very useful as the tip of branch is typically not tagged, but it is better to be consistent. * sg/describe-contains: describe --contains: default to HEAD when no commit-ish is given
This commit is contained in:
@ -443,10 +443,10 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
|
||||
if (pattern)
|
||||
argv_array_pushf(&args, "--refs=refs/tags/%s", pattern);
|
||||
}
|
||||
while (*argv) {
|
||||
argv_array_push(&args, *argv);
|
||||
argv++;
|
||||
}
|
||||
if (argc)
|
||||
argv_array_pushv(&args, argv);
|
||||
else
|
||||
argv_array_push(&args, "HEAD");
|
||||
return cmd_name_rev(args.argc, args.argv, prefix);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user