ea639a53cf
Fixes issue #1056. When you try to push `master` but also have a file named `master`, we run `git rev-list ... master`. This is ambiguous, because `rev-list` accepts paths or refs and `git` is unsure whether you mean the ref `master` or the path `master. Instead, run `git rev-list ... master --`, which is unambiguous. This adds a failing test (trying to push a file named `master` to LFS), then fixes the test by appending `--` to the command.
22 lines
420 B
Bash
Executable File
22 lines
420 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
. "test/testlib.sh"
|
|
|
|
begin_test "push a file with the same name as a branch"
|
|
(
|
|
set -e
|
|
|
|
reponame="$(basename "$0" ".sh")"
|
|
setup_remote_repo "$reponame"
|
|
clone_repo "$reponame" repo
|
|
|
|
git lfs track "master"
|
|
echo "master" > master
|
|
git add .gitattributes master
|
|
git commit -m "add master"
|
|
|
|
git lfs push --all origin master 2>&1 | tee push.log
|
|
grep "(1 of 1 files)" push.log
|
|
)
|
|
end_test
|