Skip to content

Commit

Permalink
git-repack: avoid redirecting stderr into git-pack-objects
Browse files Browse the repository at this point in the history
We are trying to catch error condition of git-rev-list and cause
the downstream pack-objects to barf, but if you run rev-list
with anything that mucks with its stderr (such as GIT_TRACE),
any stderr output would cause the pipeline to fail.

[jc: originally from Matthias Lederhofer, with a reworded error message.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Junio C Hamano committed Jul 13, 2006
1 parent 869659a commit a72f937
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ case ",$all_into_one," in
;;
esac
pack_objects="$pack_objects $local $quiet $no_reuse_delta$extra"
name=$(git-rev-list --objects --all $rev_list 2>&1 |
name=$( { git-rev-list --objects --all $rev_list ||
echo "git-rev-list died with exit code $?"
} |
git-pack-objects --non-empty $pack_objects .tmp-pack) ||
exit 1
if [ -z "$name" ]; then
Expand Down

0 comments on commit a72f937

Please sign in to comment.