File tree Expand file tree Collapse file tree 3 files changed +9
-28
lines changed Expand file tree Collapse file tree 3 files changed +9
-28
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,9 @@ do-list() {
57
57
printf -v pkg_output " %s\n" " $id "
58
58
59
59
if [ " $flag_simple " = ' no' ]; then
60
- ensure.git_repository " $pkg_path " " $id "
60
+ if [ ! -d " $pkg_path /.git" ]; then
61
+ die " Package '$id ' is not a Git repository. Unlink or otherwise remove it at '$pkg_path '"
62
+ fi
61
63
62
64
local repo_branch_str= repo_outdated_str=
63
65
Original file line number Diff line number Diff line change @@ -39,12 +39,3 @@ ensure.package_exists() {
39
39
die " Package '$package ' does not exist"
40
40
fi
41
41
}
42
-
43
- ensure.git_repository () {
44
- local dir=" $1 "
45
- local id=" $2 "
46
-
47
- if [ ! -d " $dir /.git" ]; then
48
- die " Package '$id ' is not a Git repository. Unlink or otherwise remove it at '$dir '"
49
- fi
50
- }
Original file line number Diff line number Diff line change @@ -86,26 +86,14 @@ $site/username/p1
86
86
Branch: master"
87
87
}
88
88
89
- @test " properly list outdated packages " {
89
+ @test " error if tries to list a non-git repository with details " {
90
90
local site=" github.com"
91
- local pkg1=' username/outdated'
92
- local pkg2=' username/uptodate'
91
+ local pkg=' username/outdated'
93
92
94
- test_util.create_package " $pkg1 "
95
- test_util.create_package " $pkg2 "
96
- test_util.fake_clone " $site /$pkg1 "
97
- test_util.fake_clone " $site /$pkg2 "
93
+ mkdir -p " $BPM_PACKAGES_PATH /$site /$pkg "
98
94
99
- # Make pkg1 outdated by commiting to it
100
- cd " $BPM_ORIGIN_DIR /$site /$pkg1 " ; {
101
- mkdir -p bin
102
- touch " bin/exec"
103
- git add .
104
- git commit -m " Add exec"
105
- }; cd " $BPM_CWD "
106
-
107
- run do-list --outdated
95
+ run do-list
108
96
109
- assert_success
110
- assert_output ' github.com/username/outdated '
97
+ assert_failure
98
+ assert_line -n 0 -p " Package ' $site / $pkg ' is not a Git repository. Unlink or "
111
99
}
You can’t perform that action at this time.
0 commit comments