Skip to content

Commit

Permalink
Teach ahead-behind and serialized status to play nicely together
Browse files Browse the repository at this point in the history
  • Loading branch information
jamill authored and dscho committed Jun 8, 2019
1 parent 90258dd commit 74abe74
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions t/t7524-serialized-status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,30 @@ test_expect_success 'verify serialized status handles path scopes' '
test_i18ncmp expect output
'

test_expect_success 'verify no-ahead-behind and serialized status integration' '
test_when_finished "rm serialized_status.dat new_change.txt output" &&
cat >expect <<-\EOF &&
# branch.oid 68d4a437ea4c2de65800f48c053d4d543b55c410
# branch.head alt_branch
# branch.upstream master
# branch.ab +1 -0
? expect
? serialized_status.dat
? untracked/
? untracked_1.txt
EOF
git checkout -b alt_branch master --track >/dev/null &&
touch alt_branch_changes.txt &&
git add alt_branch_changes.txt &&
test_tick &&
git commit -m"New commit on alt branch" &&
git status --untracked-files=complete --ignored=matching --serialize >serialized_status.dat &&
touch new_change.txt &&
git -c status.aheadBehind=false status --porcelain=v2 --branch --ahead-behind --deserialize=serialized_status.dat >output &&
test_i18ncmp expect output
'

test_done
2 changes: 1 addition & 1 deletion wt-status-deserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de
des_s->show_branch = cmd_s->show_branch;
des_s->show_stash = cmd_s->show_stash;
/* hints */
des_s->ahead_behind_flags = cmd_s->ahead_behind_flags;
des_s->status_format = cmd_s->status_format;
des_s->fp = cmd_s->fp;
if (cmd_s->prefix && *cmd_s->prefix)
Expand All @@ -556,7 +557,6 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de
return DESERIALIZE_OK;
}


/*
* Read raw serialized status data from the given file
*
Expand Down

0 comments on commit 74abe74

Please sign in to comment.