summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-09-17 12:19:43 +0200
committerAndreas Gruenbacher <agruen@suse.de>2010-09-17 12:19:43 +0200
commit19aecf81082fa21b47e59a3a3b828efdd82be82f (patch)
tree05765fb3106109520a5ffd9d3e767a8d158adf1f /tests
parentb73bec8e457560c5b9a19c303071f35c2e0fa936 (diff)
downloadpatch-19aecf81082fa21b47e59a3a3b828efdd82be82f.tar.gz
Fix the "patching file" message for renames and copies
* src/patch.c (main): Generate the "patching file" message here. When the input and output file name is not he same, include both names in the message. * src/inp.c (scan_input): Previously the "patching file" message was generated here. * tests/unmodified-files, tests/copy-rename: Update.
Diffstat (limited to 'tests')
-rw-r--r--tests/copy-rename18
-rw-r--r--tests/unmodified-files2
2 files changed, 7 insertions, 13 deletions
diff --git a/tests/copy-rename b/tests/copy-rename
index d8d376a..ac40f1e 100644
--- a/tests/copy-rename
+++ b/tests/copy-rename
@@ -28,9 +28,8 @@ copy to g
+new
EOF
-# FIXME: the message is confusing ...
check 'patch -p1 < copy.diff || echo "Status: $?"' <<EOF
-patching file f
+patching file g (copied from f)
EOF
check 'cat f' <<EOF
@@ -52,9 +51,8 @@ rename to h
+new
EOF
-# FIXME: the message is confusing ...
check 'patch -p1 < rename.diff || echo "Status: $?"' <<EOF
-patching file f
+patching file h (renamed from f)
EOF
ncheck 'test ! -e f'
@@ -75,9 +73,8 @@ copy from f
copy to g
EOF
-# FIXME: the message is confusing ...
check 'patch -p1 < copy.diff || echo "Status: $?"' <<EOF
-patching file f
+patching file g (copied from f)
EOF
check 'cat f' <<EOF
@@ -94,9 +91,8 @@ rename from f
rename to h
EOF
-# FIXME: the message is confusing ...
check 'patch -p1 < rename.diff || echo "Status: $?"' <<EOF
-patching file f
+patching file h (renamed from f)
EOF
ncheck 'test ! -e f'
@@ -111,9 +107,8 @@ EOF
echo old > f
rm -f g h
-# FIXME: the message is confusing ...
check 'patch -p1 --backup < copy.diff || echo "Status: $?"' <<EOF
-patching file f
+patching file g (copied from f)
EOF
ncheck 'test ! -e f.orig'
@@ -122,9 +117,8 @@ ncheck 'cat g.orig'
rm -f f.orig g.orig
-# FIXME: the message is confusing ...
check 'patch -p1 --backup < rename.diff || echo "Status: $?"' <<EOF
-patching file f
+patching file h (renamed from f)
EOF
check 'cat f.orig' <<EOF
diff --git a/tests/unmodified-files b/tests/unmodified-files
index e54777a..335787a 100644
--- a/tests/unmodified-files
+++ b/tests/unmodified-files
@@ -51,7 +51,7 @@ EOF
echo three > a
check 'patch -o b a < a.diff' <<EOF
-patching file a
+patching file b (read from a)
EOF
check 'cat b' <<EOF