Skip to content

Commit 0f27fb8

Browse files
committed
Merge branch 'master' into fix-deprecations
2 parents 9a2ce06 + 9152af8 commit 0f27fb8

11 files changed

+24
-23
lines changed

git-apply-url

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131

3232
URL=$1
3333

34-
function error {
34+
error() {
3535
echo $*
3636
exit 1
3737
}
3838

39-
if [[ ! $URL ]]; then
39+
if [ ! $URL ]; then
4040
error $0 URL
4141
fi
4242

git-clone.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function clone {
1919
$GIT clone -q $1 $2
2020
res=$?
2121

22-
cd $2
22+
cd "$2"
2323

2424
$GIT pull --all
2525

@@ -29,4 +29,4 @@ function clone {
2929
}
3030

3131
echo "cloning repository into ... $2"
32-
clone $1 $2
32+
clone $1 "$2"

git-closest-match

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ fi
1313

1414
commit=$(for i in $all; do
1515
echo -n "$i "
16+
printf '%s\n' "$i "
1617
# why is there no git diff --shortnumstat ?
1718
git diff -M $spec $i | wc -l
1819
done | sort -k 2 -n | head -n 1 | cut -f 1 -d ' ')
1920
if [ "$mode" = diff ]; then
2021
git log --no-walk $commit | cat -
2122
git diff -M $spec $commit | cat -
2223
else
23-
echo -n "$commit: "
24+
printf '%s\n' "$commit: "
2425
git diff -M $spec $commit | wc -l
2526
fi

git-filemerge

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ OLD="$1"; shift
1111
fi
1212
test $# -gt 0 && test -z "$CACHED" && NEW="$1"
1313
TMPDIR1=$(mktemp -d)
14-
git archive --format=tar $OLD | (cd $TMPDIR1; tar xf -)
14+
git archive --format=tar $OLD | (cd "$TMPDIR1"; tar xf -)
1515
if test -z "$NEW"; then
1616
TMPDIR2=$(git rev-parse --show-cdup)
1717
test -z "$cdup" && TMPDIR2=.
1818
else
1919
TMPDIR2=$(mktemp -d)
20-
git archive --format=tar $NEW | (cd $TMPDIR2; tar xf -)
20+
git archive --format=tar $NEW | (cd "$TMPDIR2"; tar xf -)
2121
fi
2222

23-
opendiff $TMPDIR1 $TMPDIR2 | cat
24-
rm -rf $TMPDIR1
25-
test ! -z "$NEW" && rm -rf $TMPDIR2
23+
opendiff "$TMPDIR1" "$TMPDIR2" | cat
24+
rm -rf "$TMPDIR1"
25+
test ! -z "$NEW" && rm -rf "$TMPDIR2"
2626

git-find-children

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ fi
77
for ref in "$@"; do
88
for sha1 in $(git rev-list "$@")
99
do
10+
:
1011
done
1112
done

git-find-useful-dangling-trees

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
depth={1:-all} # 'all' or number of depth
2+
depth=${1:-all} # 'all' or number of depth
33

44
for i in $(git fsck --unreachable | grep -E 'tree|commit' | cut -d\ -f3)
55
do

git-fire-subtree/git-fire

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ display_help() {
7171
-h, --help Display this help information
7272
7373
EOF
74-
exit 0
7574
}
7675

7776

git-remote-in-sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ ret=0
1818

1919
if [ -z "$(git branch)" ]
2020
then
21-
if [ $(cd $(git root) && ls -Al | egrep -v "^(.git|total)" | wc -l) -gt 0 ]
21+
if [ $(cd "$(git root)" && ls -Al | egrep -v "^(.git|total)" | wc -l) -gt 0 ]
2222
then
2323
echo "WARN: This repo doesn't contain any branch, but contains a bunch of files!" >&2
24-
ls -Alh $(git root)
24+
ls -Alh "$(git root)"
2525
ret=1
2626
else
2727
echo "INFO: This repo doesn't contain any branch, and is empty"

git-root

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ if [ -n "$1" ]
66
then
77
if [ -d "$1" ]
88
then
9-
cd $1
9+
cd "$1"
1010
else
11-
cd $(dirname $1)
11+
cd "$(dirname "$1")"
1212
fi
1313
fi
1414
exec git rev-parse --show-toplevel

git-save-home

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

1616
MODIFIED=$(git status | grep modified | cut -d " " -f 3-)
1717

18-
if [ "x$MODIFIED" == x ]; then
18+
if [ -n "$MODIFIED" ]; then
1919
echo no changes
2020
else
2121
git add -f $MODIFIED \

0 commit comments

Comments
 (0)