Skip to content

Commit

Permalink
contrib/diffall: create tmp dirs without mktemp
Browse files Browse the repository at this point in the history
mktemp is not available on all platforms.  Instead of littering the code
with a work-around, this commit replaces mktemp with a one-line Perl
script.

Signed-off-by: Tim Henigan <tim.henigan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Tim Henigan authored and Junio C Hamano committed Mar 14, 2012
1 parent a22a947 commit c5770f7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions contrib/diffall/git-diffall
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ cd "$cdup" || {
exit 1
}

# mktemp is not available on all platforms (missing from msysgit)
# Use a hard-coded tmp dir if it is not available
tmp="$(mktemp -d -t tmp.XXXXXX 2>/dev/null)" || {
tmp=/tmp/git-diffall-tmp.$$
mkdir "$tmp" || exit 1
}

# set up temp dir
tmp=$(perl -e 'use File::Temp qw(tempdir);
$t=tempdir("/tmp/git-diffall.XXXXX") or exit(1);
print $t') || exit 1
trap 'rm -rf "$tmp" 2>/dev/null' EXIT

left=
Expand Down

0 comments on commit c5770f7

Please sign in to comment.