diff options
| author | René Scharfe <l.s.r@web.de> | 2025-09-10 19:16:30 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-10 14:29:49 -0700 |
| commit | a66fc22bf9b7f379fc68e23c54d42ac9b7eaa845 (patch) | |
| tree | 280c7a9da4a8dc45e06af9d88b72420a340ea36c /builtin/stash.c | |
| parent | c44beea485f0f2feaf460e2ac87fdd5608d63cf0 (diff) | |
| download | git-a66fc22bf9b7f379fc68e23c54d42ac9b7eaa845.tar.gz | |
use repo_get_oid_with_flags()
get_oid_with_context() allows specifying flags and reports object
details via a passed-in struct object_context. Some callers just want
to specify flags, but don't need any details back. Convert them to
repo_get_oid_with_flags(), which provides just that and frees them from
dealing with the context structure.
Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/stash.c')
| -rw-r--r-- | builtin/stash.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/builtin/stash.c b/builtin/stash.c index 1977e50df2..e9aac85c76 100644 --- a/builtin/stash.c +++ b/builtin/stash.c @@ -1088,7 +1088,6 @@ static int store_stash(int argc, const char **argv, const char *prefix, int quiet = 0; const char *stash_msg = NULL; struct object_id obj; - struct object_context dummy = {0}; struct option options[] = { OPT__QUIET(&quiet, N_("be quiet")), OPT_STRING('m', "message", &stash_msg, "message", @@ -1108,9 +1107,8 @@ static int store_stash(int argc, const char **argv, const char *prefix, return -1; } - if (get_oid_with_context(the_repository, - argv[0], quiet ? GET_OID_QUIETLY : 0, &obj, - &dummy)) { + if (repo_get_oid_with_flags(the_repository, argv[0], &obj, + quiet ? GET_OID_QUIETLY : 0)) { if (!quiet) fprintf_ln(stderr, _("Cannot update %s with %s"), ref_stash, argv[0]); @@ -1121,7 +1119,6 @@ static int store_stash(int argc, const char **argv, const char *prefix, ret = do_store_stash(&obj, stash_msg, quiet); out: - object_context_release(&dummy); return ret; } @@ -2233,7 +2230,6 @@ static int do_export_stash(struct repository *r, const char **argv) { struct object_id base; - struct object_context unused; struct commit *prev; struct commit_list *items = NULL, **iter = &items, *cur; int res = 0; @@ -2267,9 +2263,9 @@ static int do_export_stash(struct repository *r, struct commit *stash; if (parse_stash_revision(&revision, argv[i], 1) || - get_oid_with_context(r, revision.buf, - GET_OID_QUIETLY | GET_OID_GENTLY, - &oid, &unused)) { + repo_get_oid_with_flags(r, revision.buf, &oid, + GET_OID_QUIETLY | + GET_OID_GENTLY)) { res = error(_("unable to find stash entry %s"), argv[i]); goto out; } |
