Skip to content

Commit 386f8cc

Browse files
authored
Merge pull request #10 from jeffhostetler/gvfs-2-17-1-2/gvfs-serialize-status-rename
GVFS-2-17-1-2/gvfs-serialize-status-rename
2 parents e84a454 + 36533b0 commit 386f8cc

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
@@ -204,6 +204,7 @@ static int wt_deserialize_v1_changed_items(const struct wt_status *cmd_s,
204204
d->worktree_status = ntohl(sd->fixed.worktree_status);
205205
d->index_status = ntohl(sd->fixed.index_status);
206206
d->stagemask = ntohl(sd->fixed.stagemask);
207+
d->rename_status = ntohl(sd->fixed.rename_status);
207208
d->rename_score = ntohl(sd->fixed.rename_score);
208209
d->mode_head = ntohl(sd->fixed.mode_head);
209210
d->mode_index = ntohl(sd->fixed.mode_index);
@@ -222,10 +223,11 @@ static int wt_deserialize_v1_changed_items(const struct wt_status *cmd_s,
222223

223224
trace_printf_key(
224225
&trace_deserialize,
225-
"change: %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
226+
"change: %d %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
226227
d->worktree_status,
227228
d->index_status,
228229
d->stagemask,
230+
d->rename_status,
229231
d->rename_score,
230232
d->mode_head,
231233
d->mode_index,
@@ -538,6 +540,7 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de
538540
/* show_branch */
539541
/* show_stash */
540542
/* hints */
543+
/* ahead_behind_flags */
541544
if (cmd_s->detect_rename != des_s->detect_rename) {
542545
trace_printf_key(&trace_deserialize, "reject: detect_rename");
543546
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);
@@ -79,10 +80,11 @@ static inline void wt_serialize_v1_changed(struct wt_status *s, int fd,
7980
int len_path, len_rename_source;
8081

8182
trace_printf_key(&trace_serialize,
82-
"change: %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
83+
"change: %d %d %d %d %d %o %o %o %d %d %s %s '%s' '%s'",
8384
d->worktree_status,
8485
d->index_status,
8586
d->stagemask,
87+
d->rename_status,
8688
d->rename_score,
8789
d->mode_head,
8890
d->mode_index,
@@ -97,6 +99,7 @@ static inline void wt_serialize_v1_changed(struct wt_status *s, int fd,
9799
sd.fixed.worktree_status = htonl(d->worktree_status);
98100
sd.fixed.index_status = htonl(d->index_status);
99101
sd.fixed.stagemask = htonl(d->stagemask);
102+
sd.fixed.rename_status = htonl(d->rename_status);
100103
sd.fixed.rename_score = htonl(d->rename_score);
101104
sd.fixed.mode_head = htonl(d->mode_head);
102105
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
@@ -161,6 +161,7 @@ struct wt_status_serialize_data_fixed
161161
uint32_t worktree_status;
162162
uint32_t index_status;
163163
uint32_t stagemask;
164+
uint32_t rename_status;
164165
uint32_t rename_score;
165166
uint32_t mode_head;
166167
uint32_t mode_index;

0 commit comments

Comments
 (0)