Skip to content

Commit

Permalink
Handle git-repo being a worktree
Browse files Browse the repository at this point in the history
  • Loading branch information
achalddave committed May 9, 2018
1 parent cc2c719 commit 7eebfa0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions load_git_state.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ elif [[ ! -f "${git_state_dir}/git-diff.patch" ]] ; then
error "Could not find git-diff.patch in ${git_state_dir}"
fi

if [[ ! -e "${git_repo}/.git" ]] ; then
cd ${git_repo}
if [[ ! -d ".git" ]] && ! git rev-parse --git-dir >/dev/null 2>&1 ; then
error "${git_repo} is not a git repo."
fi

cd ${git_repo}
git worktree add --detach ${output_git_repo} >/dev/null

cd ${output_git_repo}
Expand Down

0 comments on commit 7eebfa0

Please sign in to comment.