Skip to content

Commit

Permalink
Replace dummy paths with cwd
Browse files Browse the repository at this point in the history
  • Loading branch information
mkchoi212 committed Jan 1, 2018
1 parent 8f4df34 commit a7bcc41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions conflict/diff.go
@@ -1,7 +1,9 @@
package conflict

import "os"

func (c *Conflict) Diff() []string {
dummyPath := "/Users/mikechoi/src/CSCE-313/"
stdout, _, _ := RunCommand("git", dummyPath, "--no-pager", "diff", "--color")
cwd, _ := os.Getwd()
stdout, _, _ := RunCommand("git", cwd, "--no-pager", "diff", "--color")
return []string{stdout}
}
6 changes: 3 additions & 3 deletions conflict/parse.go
Expand Up @@ -145,8 +145,8 @@ func New(fname string, cwd string, lines []int) ([]Conflict, error) {
}

func Find() (err error) {
dummyPath := "/Users/mikechoi/src/CSCE-313/"
stdout, stderr, _ := RunCommand("git", dummyPath, "--no-pager", "diff", "--check")
cwd, _ := os.Getwd()
stdout, stderr, _ := RunCommand("git", cwd, "--no-pager", "diff", "--check")

if len(stderr) != 0 {
return errors.New(stderr)
Expand All @@ -168,7 +168,7 @@ func Find() (err error) {
}

for fname := range diffMap {
if out, err := New(fname, dummyPath, diffMap[fname]); err == nil {
if out, err := New(fname, cwd, diffMap[fname]); err == nil {
All = append(All, out...)
} else {
return err
Expand Down

0 comments on commit a7bcc41

Please sign in to comment.