Re: [PATCH v2 3/4] builtin/stash: provide a way to export stashes to a ref
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Mar 31, 2022, 02:09 UTC
- Message-ID
- <220331.86lewqswes.gmgdl@evledraar.gmail.com>
- In-Reply-To
- <20220329214941.2018609-4-sandals@crustytoothpaste.net>
On Tue, Mar 29 2022, brian m. carlson wrote:
Show 15 quoted lines
> + if (argc) {
> + /*
> + * Find each specified stash, and load data into the array.
> + */
> + for (int i = 0; i < argc; i++) {
> + ALLOC_GROW_BY(items, nitems, 1, nalloc);
> + if (parse_revision(&revision, argv[i], 0) ||
> + get_oid_with_context(the_repository, revision.buf,
> + GET_OID_QUIETLY | GET_OID_GENTLY,
> + &items[i], &unused)) {
> + error(_("unable to find stash entry %s"), argv[i]);
> + res = -1;
> + goto out;
> + }
> + }One thing I missed on the first read-through, in the earlier commit you
factored out parse_revision(), which now contains this code (which was
here before this series):
+ if (!commit) {
+ if (!ref_exists(ref_stash)) {
+ fprintf_ln(stderr, _("No stash entries found."));
+ return -1;
+ }Aren't we going to print both "No stash entries" and "unable to find stash entry %s" in those cases?