diff --git a/git-diffall b/git-diffall index 84f2b65..c0e5d0b 100755 --- a/git-diffall +++ b/git-diffall @@ -252,6 +252,18 @@ then find "$tmp/$right_dir" -type f | while read file do - cp "$file" "$git_top_dir/${file#$tmp/$right_dir/}" + copy_target="$git_top_dir/${file#$tmp/$right_dir/}" + if test -f "$copy_target" + then + diff -p "$copy_target" "$file" + should_cp=$? + else + echo "copy-back: $copy_target: Missing file is copied back" + should_cp=1 + fi + if test $should_cp -ne 0 + then + cp "$file" "$copy_target" + fi done fi