Skip to content

Commit

Permalink
mergetool: Don't error out in the merge case where the local file is …
Browse files Browse the repository at this point in the history
…deleted

If the file we are trying to merge resolve is in git-ls-files -u, then
skip the file existence test.  If the file isn't reported in
git-ls-files, then check to see if the file exists or not to give an
appropriate error message.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
  • Loading branch information
Theodore Ts'o committed Mar 29, 2007
1 parent 20fa04e commit ce5b6d7
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions git-mergetool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ resolve_deleted_merge () {
merge_file () {
path="$1"

if test ! -f "$path" ; then
echo "$path: file not found"
exit 1
fi

f=`git-ls-files -u -- "$path"`
if test -z "$f" ; then
echo "$path: file does not need merging"
if test ! -f "$path" ; then
echo "$path: file not found"
else
echo "$path: file does not need merging"
fi
exit 1
fi

Expand Down

0 comments on commit ce5b6d7

Please sign in to comment.