Skip to content

Commit

Permalink
Fixed shielding of git stree add
Browse files Browse the repository at this point in the history
  • Loading branch information
tdd committed May 22, 2015
1 parent d91e9e7 commit c0fbce3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions git-stree
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,21 @@ function add_subtree
ensure_attached_head
ensure_no_stage

git remote add -t "$branch" "$remote_name" "$url" &&
{ git remote add -t "$branch" "$remote_name" "$url" &&
git fetch --quiet "$remote_name" &&
git config --local "stree.$root_key.prefix" "$prefix" &&
git config --local "stree.$root_key.branch" "$branch" &&
git read-tree --prefix="$prefix" -u "$remote_name/$branch" &&
git commit -m "[STree] Added stree '$root_key' in $prefix" &&
git config --local "stree.$root_key.latest-sync" "$(git rev-parse --short HEAD)" &&
echo '' &&
yay "STree '$root_key' configured, 1st injection committed." ||

yay "STree '$root_key' configured, 1st injection committed.";
} || {
echo '' &&
git remote rm "$remote_name" &&
git config --local --remove-section "stree.$root_key" &&
error false "STree '$root_key' could not be configured."
error false "STree '$root_key' could not be configured.";
}
}

# Helper: determines whether a branch exists
Expand Down

0 comments on commit c0fbce3

Please sign in to comment.