aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm/src/org
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org')
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
index 460f24618e..ff0b55d1b8 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Add.java
@@ -22,6 +22,9 @@ import org.kohsuke.args4j.Option;
@Command(common = true, usage = "usage_addFileContentsToTheIndex")
class Add extends TextBuiltin {
+ @Option(name = "--renormalize", usage = "usage_addRenormalize")
+ private boolean renormalize = false;
+
@Option(name = "--update", aliases = { "-u" }, usage = "usage_onlyMatchAgainstAlreadyTrackedFiles")
private boolean update = false;
@@ -33,9 +36,13 @@ class Add extends TextBuiltin {
protected void run() throws Exception {
try (Git git = new Git(db)) {
AddCommand addCmd = git.add();
- addCmd.setUpdate(update);
- for (String p : filepatterns)
+ if (renormalize) {
+ update = true;
+ }
+ addCmd.setUpdate(update).setRenormalize(renormalize);
+ for (String p : filepatterns) {
addCmd.addFilepattern(p);
+ }
addCmd.call();
} catch (GitAPIException e) {
throw die(e.getMessage(), e);