Commit e67f8fe660ade54a67975730817847989b33960e
1 parent
843297b206
Tests for --branch now ready, and they pass.
Showing 2 changed files with 61 additions and 1 deletions Side-by-side Diff
Makefile
tests/branch-bundle.t
... | ... | @@ -0,0 +1,60 @@ |
1 | +Setup a plugin. | |
2 | + | |
3 | + $ mkdir plugin | |
4 | + | |
5 | +A git wrapper that works with the plugin's repo. | |
6 | + | |
7 | + $ pg () { | |
8 | + > git --git-dir plugin/.git --work-tree plugin "$@" | |
9 | + > } | |
10 | + | |
11 | +Setup the plugin repo. | |
12 | + | |
13 | + $ pg init | |
14 | + Initialized empty Git repository in .+?/plugin/\.git/? (re) | |
15 | + | |
16 | +Master branch content. | |
17 | + | |
18 | + $ cat > plugin/aliases.zsh <<EOF | |
19 | + > alias hehe='echo hehe' | |
20 | + > EOF | |
21 | + $ pg add . | |
22 | + $ pg commit -m 'Initial commit' | |
23 | + \[master \(root-commit\) [a-f0-9]{7}\] Initial commit (re) | |
24 | + 1 file changed, 1 insertion(+) | |
25 | + create mode [\d]{6} aliases\.zsh (re) | |
26 | + | |
27 | +Branch b1. | |
28 | + | |
29 | + $ pg branch b1 | |
30 | + $ pg checkout b1 | |
31 | + Switched to branch 'b1' | |
32 | + $ cat > plugin/aliases.zsh <<EOF | |
33 | + > alias hehe='echo hehe from b1' | |
34 | + > EOF | |
35 | + $ pg commit -am 'Change for b1' | |
36 | + \[b1 [a-f0-9]{7}\] Change for b1 (re) | |
37 | + 1 file changed, 1 insertion(+), 1 deletion(-) | |
38 | + | |
39 | +Go back to master. | |
40 | + | |
41 | + $ pg checkout master | |
42 | + Switched to branch 'master' | |
43 | + | |
44 | +Load plugin from b1. | |
45 | + | |
46 | + $ antigen-bundle $PWD/plugin --branch=b1 | |
47 | + Cloning into '.+?'\.\.\. (re) | |
48 | + done. | |
49 | + Switched to a new branch 'b1' | |
50 | + Branch b1 set up to track remote branch b1 from origin. | |
51 | + $ hehe | |
52 | + hehe from b1 | |
53 | + | |
54 | +Load plugin from master. | |
55 | + | |
56 | + $ antigen-bundle $PWD/plugin | |
57 | + Cloning into '.+?'\.\.\. (re) | |
58 | + done. | |
59 | + $ hehe | |
60 | + hehe |