|
@@ -4,6 +4,7 @@ import (
|
|
|
"bytes"
|
|
"bytes"
|
|
|
"fmt"
|
|
"fmt"
|
|
|
"io"
|
|
"io"
|
|
|
|
|
+ "os"
|
|
|
"os/exec"
|
|
"os/exec"
|
|
|
"path/filepath"
|
|
"path/filepath"
|
|
|
"strings"
|
|
"strings"
|
|
@@ -156,6 +157,9 @@ func (us *UnstagedScanner) Scan() (Report, error) {
|
|
|
// file in staging has been deleted, aka it is not on the filesystem
|
|
// file in staging has been deleted, aka it is not on the filesystem
|
|
|
// so the contents of the file are ""
|
|
// so the contents of the file are ""
|
|
|
currFileContents = ""
|
|
currFileContents = ""
|
|
|
|
|
+ //check if file is symlink
|
|
|
|
|
+ } else if fc, err := os.Readlink(fn); err == nil {
|
|
|
|
|
+ currFileContents = fc
|
|
|
} else {
|
|
} else {
|
|
|
workTreeBuf := bytes.NewBuffer(nil)
|
|
workTreeBuf := bytes.NewBuffer(nil)
|
|
|
workTreeFile, err := wt.Filesystem.Open(fn)
|
|
workTreeFile, err := wt.Filesystem.Open(fn)
|