Skip to content

Commit 3c8e643

Browse files
committed
commands: remove 'matched query' msg
1 parent d292a19 commit 3c8e643

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

commands/command_locks.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ func locksCommand(cmd *cobra.Command, args []string) {
2020
lockClient := newLockClient(lockRemote)
2121
defer lockClient.Close()
2222

23-
var lockCount int
2423
locks, err := lockClient.SearchLocks(filters, locksCmdFlags.Limit, locksCmdFlags.Local)
2524
// Print any we got before exiting
2625

@@ -33,13 +32,11 @@ func locksCommand(cmd *cobra.Command, args []string) {
3332

3433
for _, lock := range locks {
3534
Print("%s\t%s", lock.Path, lock.Owner)
36-
lockCount++
3735
}
3836

3937
if err != nil {
4038
Exit("Error while retrieving locks: %v", err)
4139
}
42-
Print("\n%d lock(s) matched query.", lockCount)
4340
}
4441

4542
// locksFlags wraps up and holds all of the flags that can be given to the

test/test-locks.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ begin_test "list a single lock"
1515
assert_server_lock "$reponame" "$id"
1616

1717
git lfs locks --path "f.dat" | tee locks.log
18-
grep "1 lock(s) matched query" locks.log
18+
[ $(wc -l < locks.log) -eq 1 ]
1919
grep "f.dat" locks.log
2020
grep "Git LFS Tests" locks.log
2121
)
@@ -69,7 +69,7 @@ begin_test "list locks with a limit"
6969
assert_server_lock "$reponame" "$(assert_lock "lock.log" g_2.dat)"
7070

7171
git lfs locks --limit 1 | tee locks.log
72-
grep "1 lock(s) matched query" locks.log
72+
[ $(wc -l < locks.log) -eq 1 ]
7373
)
7474
end_test
7575

@@ -105,7 +105,7 @@ begin_test "list locks with pagination"
105105

106106
# The server will return, at most, three locks at a time
107107
git lfs locks --limit 4 | tee locks.log
108-
grep "4 lock(s) matched query" locks.log
108+
[ $(wc -l < locks.log) -eq 4 ]
109109
)
110110
end_test
111111

@@ -138,16 +138,16 @@ begin_test "cached locks"
138138
assert_server_lock "$(assert_lock "lock.log" cached2.dat)"
139139

140140
git lfs locks --local | tee locks.log
141-
grep "2 lock(s) matched query" locks.log
141+
[ $(wc -l < locks.log) -eq 2 ]
142142

143143
# delete the remote to prove we're using the local records
144144
git remote remove origin
145145

146146
git lfs locks --local --path "cached1.dat" | tee locks.log
147-
grep "1 lock(s) matched query" locks.log
147+
[ $(wc -l < locks.log) -eq 1 ]
148148
grep "cached1.dat" locks.log
149149

150150
git lfs locks --local --limit 1 | tee locks.log
151-
grep "1 lock(s) matched query" locks.log
151+
[ $(wc -l < locks.log) -eq 1 ]
152152
)
153153
end_test

0 commit comments

Comments
 (0)