Skip to content

Commit a72f937

Browse files
author
Junio C Hamano
committed
git-repack: avoid redirecting stderr into git-pack-objects
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 <[email protected]>
1 parent 869659a commit a72f937

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

git-repack.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ case ",$all_into_one," in
4343
;;
4444
esac
4545
pack_objects="$pack_objects $local $quiet $no_reuse_delta$extra"
46-
name=$(git-rev-list --objects --all $rev_list 2>&1 |
46+
name=$( { git-rev-list --objects --all $rev_list ||
47+
echo "git-rev-list died with exit code $?"
48+
} |
4749
git-pack-objects --non-empty $pack_objects .tmp-pack) ||
4850
exit 1
4951
if [ -z "$name" ]; then

0 commit comments

Comments
 (0)