Compare commits

..
5 Commits
Author SHA1 Message Date
Jesse Duffield 652237d48f bump version to v0.1.59 2018-08-14 19:23:05 +10:00
Jesse Duffield 6a3f8eefa5 send version number through app 2018-08-14 19:22:38 +10:00
Jesse Duffield 8cc8c4c228 bump version to v0.1.58 2018-08-14 18:49:15 +10:00
Jesse Duffield 574b34930c support files with spaces in name 2018-08-14 18:48:08 +10:00
Jesse Duffield 77080f44a4 bump version to v0.1.57 2018-08-14 18:38:04 +10:00
3 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
v0.1.56
v0.1.59
+10 -5
View File
@@ -327,7 +327,7 @@ func (c *GitCommand) CatFile(file string) (string, error) {
// StageFile stages a file
func (c *GitCommand) StageFile(file string) error {
return c.OSCommand.RunCommand("git add " + file)
return c.OSCommand.RunCommand("git add " + c.OSCommand.Quote(file))
}
// UnStageFile unstages a file
@@ -474,18 +474,23 @@ func (c *GitCommand) Show(sha string) string {
// Diff returns the diff of a file
func (c *GitCommand) Diff(file File) string {
cachedArg := ""
fileName := file.Name
if file.HasStagedChanges && !file.HasUnstagedChanges {
cachedArg = "--cached "
cachedArg = "--cached"
} else {
// if the file is staged and has spaces in it, it comes pre-quoted
fileName = c.OSCommand.Quote(fileName)
}
deletedArg := ""
if file.Deleted {
deletedArg = "-- "
deletedArg = "--"
}
trackedArg := ""
if !file.Tracked && !file.HasStagedChanges {
trackedArg = "--no-index /dev/null "
trackedArg = "--no-index /dev/null"
}
command := "git diff --color " + cachedArg + deletedArg + trackedArg + file.Name
command := fmt.Sprintf("%s %s %s %s %s", "git diff --color ", cachedArg, deletedArg, trackedArg, fileName)
// for now we assume an error means the file was deleted
s, _ := c.OSCommand.RunCommandWithOutput(command)
return s
+1 -1
View File
@@ -68,7 +68,7 @@ func NewGui(log *logrus.Logger, gitCommand *commands.GitCommand, oSCommand *comm
Conflicts: make([]commands.Conflict, 0),
EditHistory: stack.New(),
Platform: *oSCommand.Platform,
Version: "test version", // TODO: send version in
Version: version,
}
return &Gui{