commands: teach track how to handle empty lines in .gitattributes

This commit is contained in:
risk danger olson 2017-02-07 10:33:58 -07:00
parent a9d5dd2734
commit 16664b56a9
2 changed files with 11 additions and 1 deletions

@ -119,6 +119,10 @@ ArgsLoop:
for scanner.Scan() {
line := scanner.Text()
fields := strings.Fields(line)
if len(fields) < 1 {
continue
}
pattern := fields[0]
if newline, ok := changedAttribLines[pattern]; ok {
// Replace this line (newline already embedded)

@ -12,6 +12,13 @@ begin_test "track"
cd track
git init
echo "###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
#*.cs diff=csharp" > .gitattributes
# track *.jpg once
git lfs track "*.jpg" | grep "Tracking \*.jpg"
assert_attributes_count "jpg" "filter=lfs" 1
@ -374,4 +381,3 @@ begin_test "track lockable read-only/read-write"
)
end_test