Skip to content

Commit 214123c

Browse files
committed
rebase-i: clarify "is this commit relevant?" test
While I was checking all the call sites of sane_grep and sane_egrep, I noticed this one is somewhat strangely written. The lines in the file sane_grep works on all begin with 40-hex object name, so there is no real risk of confusing "test $(...) = ''" by finding something that begins with a dash, but using the status from sane_grep makes it a lot clearer what is going on. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71b4010 commit 214123c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-rebase--interactive.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,8 @@ then
12371237
git rev-list $revisions |
12381238
while read rev
12391239
do
1240-
if test -f "$rewritten"/$rev && test "$(sane_grep "$rev" "$state_dir"/not-cherry-picks)" = ""
1240+
if test -f "$rewritten"/$rev &&
1241+
! sane_grep "$rev" "$state_dir"/not-cherry-picks >/dev/null
12411242
then
12421243
# Use -f2 because if rev-list is telling us this commit is
12431244
# not worthwhile, we don't want to track its multiple heads,

0 commit comments

Comments
 (0)