aboutsummaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorJiang Xin <worldhello.net@gmail.com>2012-04-28 20:30:50 +0800
committerJiang Xin <worldhello.net@gmail.com>2012-04-28 20:30:50 +0800
commitb240ea25a97d1b96acc4d0f5ae0dbcbe9e0af860 (patch)
treeda951e1c145cc094a6e5d634141f03b809bf3aff /git-add--interactive.perl
parent01b127cdc5d596a3022d834d82f883822c7f166b (diff)
parent868d662399786462f87df45c3d68bd5390311a6e (diff)
downloadgit-b240ea25a97d1b96acc4d0f5ae0dbcbe9e0af860.tar.gz
git-b240ea25a97d1b96acc4d0f5ae0dbcbe9e0af860.tar.xz
Merge maint branch for tracking l10n updates of git stable version
Use master branch to track l10n updates for git next release, while use maint branch to track l10n updates for git stable version.
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl25
1 files changed, 18 insertions, 7 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 8f0839d20..d948aa88d 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -268,6 +268,7 @@ sub get_empty_tree {
# FILE: is file different from index?
# INDEX_ADDDEL: is it add/delete between HEAD and index?
# FILE_ADDDEL: is it add/delete between index and file?
+# UNMERGED: is the path unmerged
sub list_modified {
my ($only) = @_;
@@ -318,16 +319,10 @@ sub list_modified {
}
}
- for (run_cmd_pipe(qw(git diff-files --numstat --summary --), @tracked)) {
+ for (run_cmd_pipe(qw(git diff-files --numstat --summary --raw --), @tracked)) {
if (($add, $del, $file) =
/^([-\d]+) ([-\d]+) (.*)/) {
$file = unquote_path($file);
- if (!exists $data{$file}) {
- $data{$file} = +{
- INDEX => 'unchanged',
- BINARY => 0,
- };
- }
my ($change, $bin);
if ($add eq '-' && $del eq '-') {
$change = 'binary';
@@ -346,6 +341,18 @@ sub list_modified {
$file = unquote_path($file);
$data{$file}{FILE_ADDDEL} = $adddel;
}
+ elsif (/^:[0-7]+ [0-7]+ [0-9a-f]+ [0-9a-f]+ (.) (.*)$/) {
+ $file = unquote_path($2);
+ if (!exists $data{$file}) {
+ $data{$file} = +{
+ INDEX => 'unchanged',
+ BINARY => 0,
+ };
+ }
+ if ($1 eq 'U') {
+ $data{$file}{UNMERGED} = 1;
+ }
+ }
}
for (sort keys %data) {
@@ -1190,6 +1197,10 @@ sub apply_patch_for_checkout_commit {
sub patch_update_cmd {
my @all_mods = list_modified($patch_mode_flavour{FILTER});
+ error_msg "ignoring unmerged: $_->{VALUE}\n"
+ for grep { $_->{UNMERGED} } @all_mods;
+ @all_mods = grep { !$_->{UNMERGED} } @all_mods;
+
my @mods = grep { !($_->{BINARY}) } @all_mods;
my @them;