Re: [PATCH v2 3/4] builtin/stash: provide a way to export stashes to a ref

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2022-03-31 at 02:09:21, Ævar Arnfjörð Bjarmason wrote:
> 
> On Tue, Mar 29 2022, brian m. carlson wrote:
> 
> > +	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?

No, we're not, because commit isn't NULL.  However, I'll put this under
the quiet flag nevertheless for the situation in the next chunk down
(where argc is 0) where this is a problem.
-- 
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux