Re: [PATCH v2 4/4] buitin-status: Add tests for submodule summary
- From
Ping Yin <pkufranky@gmail.com>
- Date
- Mar 13, 2008, 18:09 UTC
- Message-ID
- <46dff0320803131109j165cfde9v85ea9b04a05819ef@mail.gmail.com>
- In-Reply-To
- <47D93875.1050407@viscovery.net>
On Thu, Mar 13, 2008 at 10:21 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 14 quoted lines
> Ping Yin schrieb: > > > +cd sm && > > +head=$(git rev-parse --verify HEAD | cut -c1-7) && > > +cd .. > > I think you can make these three lines into: > > test_expect_success 'get short SHA1 of submodule HEAD' ' > > head=$(cd sm && git rev-parse --verify HEAD | cut -c1-7) > ' > > (not tested, though).
Hmm, It doesn't work. Since i need $head1 outputed to file expect as follows
+cat > expect <<EOF +# On branch master +# Changes to be committed: +# (use "git reset HEAD^1 <file>..." to unstage) +# +# new file: dir2/added +# new file: sm +# +# Changed but not updated: +# (use "git add <file>..." to update what will be committed) +# +# modified: dir1/modified +# +# Modified submodules: +# +# * sm 0000000...$head (1):
Here we need $head.
-- Ping Yin