starting work on new commit logic
This commit is contained in:
@@ -220,8 +220,10 @@ func (m *Manager) BeginCommit(branch string, commitMessage string) error {
|
||||
m.Err(err).Msgf("unable to create initial commit: %s", err)
|
||||
return err
|
||||
}
|
||||
m.Info().Msgf("Initial Commit Created, returning...")
|
||||
return nil
|
||||
}
|
||||
var filesToDiff []database.File // Contains the list of files that have changed
|
||||
var filesToDiff []database.File // Contains the list of files that have changed since the initial commit
|
||||
for _, trackedFile := range trackedFiles {
|
||||
fmt.Println("Working on file: ", trackedFile.Path)
|
||||
if trackedFile.Path == "" {
|
||||
@@ -253,7 +255,12 @@ func (m *Manager) BeginCommit(branch string, commitMessage string) error {
|
||||
m.Info().Msgf("No changed files found to commit on branch: %s", branch)
|
||||
return fmt.Errorf("no changed files, cannot commit on branch: %s", branch)
|
||||
}
|
||||
fmt.Println("COMMIT: ", commit.CommitHash)
|
||||
fmt.Println("COMMIT: ", hex.EncodeToString(commit.CommitHash))
|
||||
newCommitNumber := commit.Number + 1
|
||||
err = m.CreateCommit(filesToDiff, trackedFiles, branch, commitMessage, newCommitNumber)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user