add a test for wt rm vs repo rm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
diff --git a/regress/cmdline/update.sh b/regress/cmdline/update.sh
index f5e6128..76a9eee 100755
--- a/regress/cmdline/update.sh
+++ b/regress/cmdline/update.sh
@@ -1022,6 +1022,55 @@ function test_update_conflict_wt_rm_vs_repo_edit {
test_done "$testroot" "$ret"
}
+function test_update_conflict_wt_rm_vs_repo_rm {
+ local testroot=`test_init update_conflict_wt_rm_vs_repo_rm`
+
+ got checkout $testroot/repo $testroot/wt > /dev/null
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
+ (cd $testroot/repo && git rm -q beta)
+ git_commit $testroot/repo -m "removing a file"
+
+ (cd $testroot/wt && got rm beta > /dev/null)
+
+ (cd $testroot/wt && got update > $testroot/stdout)
+
+ echo "D beta" > $testroot/stdout.expected
+ echo -n "Updated to commit " >> $testroot/stdout.expected
+ git_show_head $testroot/repo >> $testroot/stdout.expected
+ echo >> $testroot/stdout.expected
+ cmp $testroot/stdout.expected $testroot/stdout
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ diff -u $testroot/stdout.expected $testroot/stdout
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
+ # beta is now gone... we don't flag tree conflicts yet
+ echo 'got: bad path' > $testroot/stderr.expected
+ (cd $testroot/wt && got status beta 2> $testroot/stderr)
+ cmp $testroot/stderr.expected $testroot/stderr
+ ret="$?"
+ if [ "$ret" != "0" ]; then
+ diff -u $testroot/stderr.expected $testroot/stderr
+ test_done "$testroot" "$ret"
+ return 1
+ fi
+
+ if [ -e $testroot/wt/beta ]; then
+ echo "removed file beta still exists on disk" >&2
+ test_done "$testroot" "1"
+ return 1
+ fi
+
+ test_done "$testroot" "0"
+}
+
run_test test_update_basic
run_test test_update_adds_file
run_test test_update_deletes_file
@@ -1042,3 +1091,4 @@ run_test test_update_restores_missing_file
run_test test_update_conflict_wt_add_vs_repo_add
run_test test_update_conflict_wt_edit_vs_repo_rm
run_test test_update_conflict_wt_rm_vs_repo_edit
+run_test test_update_conflict_wt_rm_vs_repo_rm