mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Merge branch 'jc/name' into next
* jc/name: sha1_name: make core.warnambiguousrefs the default. sha1_name: warning ambiguous refs.
This commit is contained in:
commit
88d9405600
1
blame.c
1
blame.c
|
@ -752,6 +752,7 @@ int main(int argc, const char **argv)
|
|||
int found_rename;
|
||||
|
||||
const char* prefix = setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
for(i = 1; i < argc; i++) {
|
||||
if(options) {
|
||||
|
|
|
@ -100,6 +100,7 @@ int main(int argc, char **argv)
|
|||
int opt;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
if (argc != 3 || get_sha1(argv[2], sha1))
|
||||
usage("git-cat-file [-t|-s|-e|-p|<type>] <sha1>");
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ char git_default_name[MAX_GITNAME];
|
|||
int trust_executable_bit = 1;
|
||||
int assume_unchanged = 0;
|
||||
int only_use_symrefs = 0;
|
||||
int warn_ambiguous_refs = 0;
|
||||
int warn_ambiguous_refs = 1;
|
||||
int repository_format_version = 0;
|
||||
char git_commit_encoding[MAX_ENCODING_LENGTH] = "utf-8";
|
||||
int shared_repository = 0;
|
||||
|
|
|
@ -90,6 +90,7 @@ int main(int argc, const char **argv)
|
|||
struct tree *tree;
|
||||
|
||||
prefix = setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
if (prefix && *prefix)
|
||||
chomp_prefix = strlen(prefix);
|
||||
while (1 < argc && argv[1][0] == '-') {
|
||||
|
|
|
@ -237,6 +237,7 @@ int main(int argc, char **argv)
|
|||
unsigned char rev1key[20], rev2key[20];
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
while (1 < argc && argv[1][0] == '-') {
|
||||
char *arg = argv[1];
|
||||
|
|
|
@ -127,6 +127,7 @@ int main(int argc, char **argv)
|
|||
int as_is = 0, all = 0, transform_stdin = 0;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
if (argc < 2)
|
||||
usage(name_rev_usage);
|
||||
|
|
|
@ -717,6 +717,7 @@ int main(int argc, char **argv)
|
|||
merge_fn_t fn = NULL;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
newfd = hold_index_file_for_update(&cache_file, get_index_file());
|
||||
if (newfd < 0)
|
||||
|
|
|
@ -166,6 +166,8 @@ int main(int argc, char **argv)
|
|||
unsigned char sha1[20];
|
||||
const char *prefix = setup_git_directory();
|
||||
|
||||
git_config(git_default_config);
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
struct stat st;
|
||||
char *arg = argv[i];
|
||||
|
|
|
@ -362,6 +362,8 @@ int main(int argc, char **argv)
|
|||
pid_t pid;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
argv++;
|
||||
for (i = 1; i < argc; i++, argv++) {
|
||||
char *arg = *argv;
|
||||
|
|
|
@ -236,7 +236,7 @@ static int ambiguous_path(const char *path, int len)
|
|||
static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
|
||||
{
|
||||
static const char *fmt[] = {
|
||||
"/%.*s",
|
||||
"%.*s",
|
||||
"refs/%.*s",
|
||||
"refs/tags/%.*s",
|
||||
"refs/heads/%.*s",
|
||||
|
@ -263,8 +263,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
|
|||
pathname = git_path(*p, len, str);
|
||||
if (!read_ref(pathname, this_result)) {
|
||||
if (warn_ambiguous_refs) {
|
||||
if (already_found &&
|
||||
!memcmp(sha1, sha1_from_ref, 20))
|
||||
if (already_found)
|
||||
fprintf(stderr, warning, len, str);
|
||||
already_found++;
|
||||
}
|
||||
|
|
|
@ -380,6 +380,7 @@ int main(int argc, char **argv)
|
|||
struct tree_desc tree;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
switch (argc) {
|
||||
case 3:
|
||||
|
|
|
@ -30,6 +30,7 @@ int main(int argc, char **argv)
|
|||
usage("git-unpack-file <sha1>");
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
|
||||
puts(create_temp_file(sha1));
|
||||
return 0;
|
||||
|
|
|
@ -25,6 +25,7 @@ int main(int argc, char **argv)
|
|||
int fd, written;
|
||||
|
||||
setup_git_directory();
|
||||
git_config(git_default_config);
|
||||
if (argc < 3 || argc > 4)
|
||||
usage(git_update_ref_usage);
|
||||
|
||||
|
|
Loading…
Reference in a new issue