From 5ee48f715870b8efec0198311e3e1074a1bb3575 Mon Sep 17 00:00:00 2001 From: redhoyasa Date: Wed, 12 Oct 2022 16:32:15 +0700 Subject: [PATCH] adding source and dest prefix regardless user's noprefix config --- README.md | 2 +- contributing.md | 2 +- gitrepo/gitrepo.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06df4e70..5da0a3ec 100644 --- a/README.md +++ b/README.md @@ -518,7 +518,7 @@ Talisman CLI tool `talisman` also comes with the capability to provide detailed * `talisman --scanWithHtml` -This will scan the repository and create a folder `talisman_html_report` under the the scanned repository. We need to start an HTTP server inside this repository to access the report.Below is a recommended approach to start a HTTP server: +This will scan the repository and create a folder `talisman_html_report` under the scanned repository. We need to start an HTTP server inside this repository to access the report.Below is a recommended approach to start a HTTP server: * `python -m SimpleHTTPServer (eg: 8000)` diff --git a/contributing.md b/contributing.md index e00a06dd..bfb01027 100644 --- a/contributing.md +++ b/contributing.md @@ -38,7 +38,7 @@ To send in a pull request 1. Fork the repo. 2. Create a new feature branch based off the master branch. -3. Provide the commit message with the the issue number and a proper description. +3. Provide the commit message with the issue number and a proper description. 4. Ensure that all the tests pass. 5. Submit the pull request. diff --git a/gitrepo/gitrepo.go b/gitrepo/gitrepo.go index 6af428bf..50470576 100644 --- a/gitrepo/gitrepo.go +++ b/gitrepo/gitrepo.go @@ -40,7 +40,7 @@ func RepoLocatedAt(path string) GitRepo { // GetDiffForStagedFiles gets all the staged files and collects the diff section in each file func (repo GitRepo) GetDiffForStagedFiles() []Addition { - stagedContent := repo.executeRepoCommand("git", "diff", "--staged") + stagedContent := repo.executeRepoCommand("git", "diff", "--staged", "--src-prefix=a/", "--dst-prefix=b/") content := strings.TrimSpace(string(stagedContent)) lines := strings.Split(content, "\n") result := make([]Addition, 0)