Add test to check recent fix to "git add -u"
An earlier commit fixed type-change case in "git add -u". This adds a test to make sure we do not introduce regression. At the same time, it fixes a stupid typo in the error message. Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Benoit Sigoure committed
Sep 14, 2007 at 10:29 UTC
43b98acc23306fd7fff888477937063361a09593
2 files changed
+11
-2
builtin-add.c
+1
-1
@@ -95,7 +95,7 @@ static void update_callback(struct diff_queue_struct *q,
95
const char *path = p->one->path;
96
switch (p->status) {
97
default:
98
- die("unexpacted diff status %c", p->status);
98
+ die("unexpected diff status %c", p->status);
99
case DIFF_STATUS_UNMERGED:
100
case DIFF_STATUS_MODIFIED:
101
case DIFF_STATUS_TYPE_CHANGED:
t/t2200-add-update.sh
+10
-1
@@ -16,11 +16,12 @@ only the updates to dir/sub.'
16
test_expect_success setup '
17
echo initial >check &&
18
echo initial >top &&
19
+ echo initial >foo &&
20
mkdir dir1 dir2 &&
21
echo initial >dir1/sub1 &&
22
echo initial >dir1/sub2 &&
23
echo initial >dir2/sub3 &&
23
- git add check dir1 dir2 top &&
24
+ git add check dir1 dir2 top foo &&
25
test_tick
26
git-commit -m initial &&
27
@@ -76,4 +77,12 @@ test_expect_success 'change gets noticed' '
77
78
'
79
80
+test_expect_success 'replace a file with a symlink' '
81
+
82
+ rm foo &&
83
+ ln -s top foo &&
84
+ git add -u -- foo
85
+
86
+'
87
+
88
test_done