Skip to content

Commit dae67d4

Browse files
authored
Merge pull request #24 from OpenVoxProject/ci2a
move helper shell script out of git ignored path
2 parents 3453bcd + e9cbd30 commit dae67d4

2 files changed

Lines changed: 22 additions & 21 deletions

File tree

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ namespace :externalsources do
135135
local_repo = safe_dirname(info['repo'])
136136
unless File.directory?(workdir)
137137
puts "Making new working directory for #{url}"
138-
system ("\"#{top_dir}/vendor/bin/git-new-workdir\" '#{local_repo}' '#{workdir}' '#{info['commit']}'")
138+
system ("\"#{top_dir}/bin/git-new-workdir.sh\" '#{local_repo}' '#{workdir}' '#{info['commit']}'")
139139
end
140140
Dir.chdir(workdir) do
141141
puts "Updating #{url}"
Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
#!/bin/sh
22

33
usage () {
4-
echo "usage:" $@
5-
exit 127
4+
echo "usage:" $@
5+
exit 127
66
}
77

88
die () {
9-
echo $@
10-
exit 128
9+
echo $@
10+
exit 128
1111
}
1212

1313
if test $# -lt 2 || test $# -gt 3
1414
then
15-
usage "$0 <repository> <new_workdir> [<branch>]"
15+
usage "$0 <repository> <new_workdir> [<branch>]"
1616
fi
1717

1818
orig_git=$1
@@ -26,32 +26,32 @@ git_dir=$(cd "$orig_git" 2>/dev/null &&
2626

2727
case "$git_dir" in
2828
.git)
29-
git_dir="$orig_git/.git"
30-
;;
29+
git_dir="$orig_git/.git"
30+
;;
3131
.)
32-
git_dir=$orig_git
33-
;;
32+
git_dir=$orig_git
33+
;;
3434
esac
3535

3636
# don't link to a configured bare repository
3737
isbare=$(git --git-dir="$git_dir" config --bool --get core.bare)
3838
if test ztrue = z$isbare
3939
then
40-
die "\"$git_dir\" has core.bare set to true," \
41-
" remove from \"$git_dir/config\" to use $0"
40+
die "\"$git_dir\" has core.bare set to true," \
41+
" remove from \"$git_dir/config\" to use $0"
4242
fi
4343

4444
# don't link to a workdir
4545
if test -h "$git_dir/config"
4646
then
47-
die "\"$orig_git\" is a working directory only, please specify" \
48-
"a complete repository."
47+
die "\"$orig_git\" is a working directory only, please specify" \
48+
"a complete repository."
4949
fi
5050

5151
# don't recreate a workdir over an existing repository
5252
if test -e "$new_workdir"
5353
then
54-
die "destination directory '$new_workdir' already exists."
54+
die "destination directory '$new_workdir' already exists."
5555
fi
5656

5757
# make sure the links use full paths
@@ -65,12 +65,12 @@ mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!"
6565
# directory, and should not be shared.
6666
for x in config refs logs/refs objects info hooks packed-refs remotes rr-cache svn
6767
do
68-
case $x in
69-
*/*)
70-
mkdir -p "$(dirname "$new_workdir/.git/$x")"
71-
;;
72-
esac
73-
ln -s "$git_dir/$x" "$new_workdir/.git/$x"
68+
case $x in
69+
*/*)
70+
mkdir -p "$(dirname "$new_workdir/.git/$x")"
71+
;;
72+
esac
73+
ln -s "$git_dir/$x" "$new_workdir/.git/$x"
7474
done
7575

7676
# now setup the workdir
@@ -80,3 +80,4 @@ cp "$git_dir/HEAD" .git/HEAD
8080
# checkout the branch (either the same as HEAD from the original repository, or
8181
# the one that was asked for)
8282
git checkout -f $branch
83+

0 commit comments

Comments
 (0)