commands: teach track how to handle empty lines in .gitattributes
This commit is contained in:
parent
a9d5dd2734
commit
16664b56a9
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user