]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-add--interactive.perl
First batch
[thirdparty/git.git] / git-add--interactive.perl
index 6771c0a0267c594e9ef51a376523c74afe3a1b6a..e713fe3d022effd7905317b25d26bc6ab84914c5 100755 (executable)
@@ -714,7 +714,7 @@ sub parse_diff {
        if (defined $patch_mode_revision) {
                push @diff_cmd, get_diff_reference($patch_mode_revision);
        }
-       my @diff = run_cmd_pipe("git", @diff_cmd, "--", $path);
+       my @diff = run_cmd_pipe("git", @diff_cmd, qw(--no-color --), $path);
        my @colored = ();
        if ($diff_use_color) {
                my @display_cmd = ("git", @diff_cmd, qw(--color --), $path);
@@ -1830,6 +1830,13 @@ sub process_args {
                                $arg = shift @ARGV or die __("missing --");
                                if ($arg ne '--') {
                                        $patch_mode_revision = $arg;
+
+                                       # NEEDSWORK: Instead of comparing to the literal "HEAD",
+                                       # compare the commit objects instead so that other ways of
+                                       # saying the same thing (such as "@") are also handled
+                                       # appropriately.
+                                       #
+                                       # This applies to the cases below too.
                                        $patch_mode = ($arg eq 'HEAD' ?
                                                       'reset_head' : 'reset_nothead');
                                        $arg = shift @ARGV or die __("missing --");