Skip to content

Commit a5f9cc2

Browse files
jeffhostetlerdscho
authored andcommitted
Merge pull request #6 from jeffhostetler/gvfs-serialize-status-rename
GVFS serialize status updates
2 parents 08156ed + 6ba7cd1 commit a5f9cc2

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

t/t7524-serialized-status.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,16 @@ EOF
269269
270270
'
271271

272+
test_expect_success 'renames' '
273+
git init rename_test &&
274+
echo OLDNAME >rename_test/OLDNAME &&
275+
git -C rename_test add OLDNAME &&
276+
git -C rename_test commit -m OLDNAME &&
277+
git -C rename_test mv OLDNAME NEWNAME &&
278+
git -C rename_test status --serialize=renamed.dat >output.1 &&
279+
echo DIRT >rename_test/DIRT &&
280+
git -C rename_test status --deserialize=renamed.dat >output.2 &&
281+
test_i18ncmp output.1 output.2
282+
'
283+
272284
test_done

wt-status-deserialize.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ static int wt_deserialize_v1_changed_items(const struct wt_status *cmd_s,
200200
d->worktree_status = ntohl(sd->fixed.worktree_status);
201201
d->index_status = ntohl(sd->fixed.index_status);
202202
d->stagemask = ntohl(sd->fixed.stagemask);
203+
d->rename_status = ntohl(sd->fixed.rename_status);
203204
d->rename_score = ntohl(sd->fixed.rename_score);
204205
d->mode_head = ntohl(sd->fixed.mode_head);
205206
d->mode_index = ntohl(sd->fixed.mode_index);
@@ -218,10 +219,11 @@ static int wt_deserialize_v1_changed_items(const struct wt_status *cmd_s,
218219

219220
trace_printf_key(
220221
&trace_deserialize,
221-
"change: %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
222+
"change: %d %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
222223
d->worktree_status,
223224
d->index_status,
224225
d->stagemask,
226+
d->rename_status,
225227
d->rename_score,
226228
d->mode_head,
227229
d->mode_index,
@@ -534,6 +536,7 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de
534536
/* show_branch */
535537
/* show_stash */
536538
/* hints */
539+
/* ahead_behind_flags */
537540
if (cmd_s->detect_rename != des_s->detect_rename) {
538541
trace_printf_key(&trace_deserialize, "reject: detect_rename");
539542
return DESERIALIZE_ERR;

wt-status-serialize.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static void wt_serialize_v1_header(struct wt_status *s, int fd)
4848
/* show_branch */
4949
/* show_stash */
5050
packet_write_fmt(fd, "hints %d\n", s->hints);
51+
/* ahead_behind_flags */
5152
packet_write_fmt(fd, "detect_rename %d\n", s->detect_rename);
5253
packet_write_fmt(fd, "rename_score %d\n", s->rename_score);
5354
packet_write_fmt(fd, "rename_limit %d\n", s->rename_limit);
@@ -78,10 +79,11 @@ static inline void wt_serialize_v1_changed(struct wt_status *s, int fd,
7879
int len_path, len_rename_source;
7980

8081
trace_printf_key(&trace_serialize,
81-
"change: %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
82+
"change: %d %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
8283
d->worktree_status,
8384
d->index_status,
8485
d->stagemask,
86+
d->rename_status,
8587
d->rename_score,
8688
d->mode_head,
8789
d->mode_index,
@@ -96,6 +98,7 @@ static inline void wt_serialize_v1_changed(struct wt_status *s, int fd,
9698
sd.fixed.worktree_status = htonl(d->worktree_status);
9799
sd.fixed.index_status = htonl(d->index_status);
98100
sd.fixed.stagemask = htonl(d->stagemask);
101+
sd.fixed.rename_status = htonl(d->rename_status);
99102
sd.fixed.rename_score = htonl(d->rename_score);
100103
sd.fixed.mode_head = htonl(d->mode_head);
101104
sd.fixed.mode_index = htonl(d->mode_index);

wt-status.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ struct wt_status_serialize_data_fixed
158158
uint32_t worktree_status;
159159
uint32_t index_status;
160160
uint32_t stagemask;
161+
uint32_t rename_status;
161162
uint32_t rename_score;
162163
uint32_t mode_head;
163164
uint32_t mode_index;

0 commit comments

Comments
 (0)