Skip to content

Commit 7bd93c1

Browse files
Dan Loewenherzgitster
authored andcommitted
Convert to use quiet option when available
A minor fix that eliminates usage of "2>/dev/null" when --quiet or -q has already been implemented. Signed-off-by: Dan Loewenherz <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b18cc5a commit 7bd93c1

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

git-filter-branch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ if [ "$filter_tag_name" ]; then
430430
if [ "$type" = "tag" ]; then
431431
# Dereference to a commit
432432
sha1t="$sha1"
433-
sha1="$(git rev-parse "$sha1"^{commit} 2>/dev/null)" || continue
433+
sha1="$(git rev-parse -q "$sha1"^{commit})" || continue
434434
fi
435435

436436
[ -f "../map/$sha1" ] || continue

git-merge-resolve.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ then
3737
exit 2
3838
fi
3939

40-
git update-index --refresh 2>/dev/null
40+
git update-index -q --refresh
4141
git read-tree -u -m --aggressive $bases $head $remotes || exit 2
4242
echo "Trying simple merge."
43-
if result_tree=$(git write-tree 2>/dev/null)
43+
if result_tree=$(git write-tree 2>/dev/null)
4444
then
4545
exit 0
4646
else

git-parse-remote.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# git-ls-remote could be called from outside a git managed repository;
44
# this would fail in that case and would issue an error message.
5-
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) || :;
5+
GIT_DIR=$(git rev-parse -q --git-dir) || :;
66

77
get_data_source () {
88
case "$1" in

git-pull.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ then
147147
echo >&2 "Warning: fetch updated the current branch head."
148148
echo >&2 "Warning: fast forwarding your working tree from"
149149
echo >&2 "Warning: commit $orig_head."
150-
git update-index --refresh 2>/dev/null
150+
git update-index -q --refresh
151151
git read-tree -u -m "$orig_head" "$curr_head" ||
152152
die 'Cannot fast-forward your working tree.
153153
After making sure that you saved anything precious from

0 commit comments

Comments
 (0)