Skip to content

Commit 203b17d

Browse files
committed
git-all: added --fetchonly option
1 parent 23e78a9 commit 203b17d

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

git-all

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,17 @@ module GitUpdate
109109
g = Git.open(working_dir, :log => logger)
110110
@git_dir = File.join working_dir, '.git'
111111

112-
if $params[:fetch].value
112+
if $params[:fetch].value or $params[:fetchonly].value
113113
fetch g, working_dir
114114
end
115115

116-
g.branches.local.each do |branch|
117-
if not branch.current or git_svn_repo g
116+
if not $params[:fetchonly].value
117+
g.branches.local.each do |branch|
118118
push_or_pull g, working_dir, branch
119119
end
120-
end
121120

122-
status working_dir
121+
status working_dir
122+
end
123123
end
124124
end
125125

@@ -133,6 +133,9 @@ Main {
133133
option(:fetch) {
134134
description 'Fetch from all remotes'
135135
}
136+
option(:fetchonly) {
137+
description 'Only fetch, nothing else'
138+
}
136139
option(:untracked) {
137140
description 'Display untracked files as possible changes'
138141
}

0 commit comments

Comments
 (0)