Skip to content

Commit

Permalink
Fix spotify#5: Have file/s and branche/s with same name
Browse files Browse the repository at this point in the history
This confuses git rev-list, so now we always use the -- separator.
  • Loading branch information
Anders Eurenius committed Jul 7, 2016
1 parent f81f784 commit 4f59170
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions git-test
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ if [ $action = clear ] ; then
rm -f "$cache"/*_fail "$cache"/*_pass
else
refs="$(decide_refs "$@")"
commits="$(git rev-list --reverse $refs | tr "$NL" " ")"
commits="$(git rev-list --reverse $refs -- | tr "$NL" " ")"
count="$(echo "$commits" | wc -w)"

if test 1 -gt "$count" ; then
Expand Down Expand Up @@ -469,7 +469,7 @@ fi

refs="$(decide_refs "$@")"
refs="${refs% }"
commits="$(git rev-list --reverse $refs | tr "$NL" " ")"
commits="$(git rev-list --reverse $refs -- | tr "$NL" " ")"
count="$(echo "$commits" | wc -w)"

if test 1 -gt "$count" ; then
Expand Down
8 changes: 8 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,14 @@ info "Should just show version, even when not in a repo"
GIT_DIR=.git/refs $PROJECT --version >out 2>err ; check
grep "Not a git repo" out err >/dev/null 2>&1 ; check_fail

info "Should not confuse files and branches"
$PROJECT --clear >/dev/null 2>&1 ; check
git checkout -b subject >/dev/null 2>&1 ; check
add_commit "x" "differentiate branches" >/dev/null 2>&1 ; check
$PROJECT -v --verify=true subject ^master >out 2>err ; check
grep "^iter.*commit.*tree.*result$" out err >/dev/null 2>&1 ; check


info "TODO: check output report feature/s"

if [ $verb -ge 1 ]; then
Expand Down

0 comments on commit 4f59170

Please sign in to comment.