Skip to content

Commit bfe392e

Browse files
thenigangitster
authored andcommitted
contrib/diffall: fix cleanup trap on Windows
Prior to this commit, the cleanup trap that removes the tmp dir created by the script would fail on Windows. The error was silently ignored by the script. On Windows, a directory cannot be removed while it is the working directory of the process (thanks to Johannes Sixt on the Git list for this info [1]). This commit eliminates the 'cd' into the tmp directory that caused the error. [1]: http://article.gmane.org/gmane.comp.version-control.git/193086 Signed-off-by: Tim Henigan <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9754908 commit bfe392e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

contrib/diffall/git-diffall

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ cd "$cdup" || {
4949
tmp=$(perl -e 'use File::Temp qw(tempdir);
5050
$t=tempdir("/tmp/git-diffall.XXXXX") or exit(1);
5151
print $t') || exit 1
52-
trap 'rm -rf "$tmp" 2>/dev/null' EXIT
52+
trap 'rm -rf "$tmp"' EXIT
5353

5454
left=
5555
right=
@@ -233,9 +233,8 @@ do
233233
fi
234234
done < "$tmp/filelist"
235235

236-
cd "$tmp"
237-
LOCAL="$left_dir"
238-
REMOTE="$right_dir"
236+
LOCAL="$tmp/$left_dir"
237+
REMOTE="$tmp/$right_dir"
239238

240239
if test -n "$diff_tool"
241240
then

0 commit comments

Comments
 (0)