+
Skip to content

minor fix in git-new-workdir #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions contrib/workdir/git-new-workdir
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ new_workdir=$2
branch=$3

# want to make sure that what is pointed to has a .git directory ...
git_dir=$(cd "$orig_git" 2>/dev/null &&
git_dir=$(cd "$orig_git" &>/dev/null &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "&>" construct is a bash-ism picked up by a few other shells. But
it's not portable to shells like dash. You have to use ">/dev/null 2>&1"
instead.

git rev-parse --git-dir 2>/dev/null) ||
die "Not a git repository: \"$orig_git\""

Expand Down Expand Up @@ -55,7 +55,7 @@ then
fi

# make sure the links use full paths
git_dir=$(cd "$git_dir"; pwd)
git_dir=$(cd "$git_dir" &>/dev/null; pwd)

# create the workdir
mkdir -p "$new_workdir/.git" || die "unable to create \"$new_workdir\"!"
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载