diff options
author | Jeff Hostetler <jeffhost@microsoft.com> | 2016-08-11 14:45:59 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-11 18:15:40 (GMT) |
commit | d9fc746cd77910a7dec53abfec36df5c699b33c2 (patch) | |
tree | 03b5603ad466ee45e75e026c3869fa537282bea6 /builtin/commit.c | |
parent | 24959bad5dba353497323f10b3bf39f243c0f174 (diff) | |
download | git-d9fc746cd77910a7dec53abfec36df5c699b33c2.zip git-d9fc746cd77910a7dec53abfec36df5c699b33c2.tar.gz git-d9fc746cd77910a7dec53abfec36df5c699b33c2.tar.bz2 |
status: print branch info with --porcelain=v2 --branch
Expand porcelain v2 output to include branch and tracking
branch information. This includes the commit id, the branch,
the upstream branch, and the ahead and behind counts.
Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r-- | builtin/commit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 3d222d3..5504afe 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -510,6 +510,8 @@ static int run_status(FILE *fp, const char *index_file, const char *prefix, int s->fp = fp; s->nowarn = nowarn; s->is_initial = get_sha1(s->reference, sha1) ? 1 : 0; + if (!s->is_initial) + hashcpy(s->sha1_commit, sha1); s->status_format = status_format; s->ignore_submodule_arg = ignore_submodule_arg; @@ -1378,6 +1380,9 @@ int cmd_status(int argc, const char **argv, const char *prefix) fd = hold_locked_index(&index_lock, 0); s.is_initial = get_sha1(s.reference, sha1) ? 1 : 0; + if (!s.is_initial) + hashcpy(s.sha1_commit, sha1); + s.ignore_submodule_arg = ignore_submodule_arg; s.status_format = status_format; s.verbose = verbose; |