diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:21 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-02-06 22:05:21 -0800 |
| commit | cfd9167c15e7b09f3964204964a4c158108c6403 (patch) | |
| tree | 678a4051a44c8931ea469123528679e9987d0689 /builtin | |
| parent | a3d41733f9dd0d638d1538b54d516fed033c165b (diff) | |
| parent | df799f5d99ac51d4fc791d546de3f936088582fc (diff) | |
| download | git-cfd9167c15e7b09f3964204964a4c158108c6403.tar.gz | |
Merge branch 'dt/cat-file-batch-ambiguous'
"git cat-file --batch" reported a dangling symbolic link by
mistake, when it wanted to report that a given name is ambiguous.
* dt/cat-file-batch-ambiguous:
t1512: test ambiguous cat-file --batch and --batch-output
Do not print 'dangling' for cat-file in case of ambiguity
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/cat-file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 2ca56fd086..cebc6d7f8a 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -380,7 +380,7 @@ static void batch_one_object(const char *obj_name, { struct object_context ctx; int flags = opt->follow_symlinks ? GET_OID_FOLLOW_SYMLINKS : 0; - enum follow_symlinks_result result; + enum get_oid_result result; result = get_oid_with_context(obj_name, flags, &data->oid, &ctx); if (result != FOUND) { @@ -388,6 +388,9 @@ static void batch_one_object(const char *obj_name, case MISSING_OBJECT: printf("%s missing\n", obj_name); break; + case SHORT_NAME_AMBIGUOUS: + printf("%s ambiguous\n", obj_name); + break; case DANGLING_SYMLINK: printf("dangling %"PRIuMAX"\n%s\n", (uintmax_t)strlen(obj_name), obj_name); |
