Re: [PATCH v5 06/10] fast-export: add new --refspec option
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 31, 2013, 18:26 UTC
- Message-ID
- <xmqq61sd70vw.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1383212197-14259-6-git-send-email-felipe.contreras@gmail.com>
Felipe Contreras <felipe.contreras@gmail.com> writes:
> +test_expect_success 'use refspec' ' > + git fast-export --refspec refs/heads/master:refs/heads/foobar master | \ > + grep "^commit " | sort | uniq > actual &&
It feels somewhat redundant that you have to twice say that you are pushing your "master", once with --refspec and then the branch name. Is this the best we can do?
If the answer is "yes", I guess it is OK to leave the external interface to fast-export of this patch as-is, but if we can do better, then we'd be better off without redundancy.
There are quite a few shell script style violations in this test, by the way. You do not want the trailing " \" after a pipe (the shell, when seeing a line that ends with "|", knows you haven't finished giving it the pipeline). Also we do not put extra space between a redirection operator and the target filename.
Show 5 quoted lines
> + echo "commit refs/heads/foobar" > expected && > + test_cmp expected actual > +' > + > test_done